以下是一些常用的 PowerShell 命令和示例: 1. 获取注册表项的值 使用Get-ItemProperty 命令可以获取指定注册表路径下的键值信息。 powershellCopy Code # 获取注册表项的值 Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "ShellState" 2. 设置注册表项的值 使用Set-...
Microsoft.PowerShell.Core 指令 简介 Add-History Clear-History Clear-Host(清除主机) Connect-PSSession Debug-Job Disable-ExperimentalFeature Disable-PSRemoting Disable-PSSessionConfiguration Disconnect-PSSession Enable-ExperimentalFeature Enable-PSRemoting
PowerShell includes the following aliases forGet-Variable: All platforms: gv This cmdlet does not manage environment variables. To manage environment variables, you can use the Environment provider. Related Links In this article Syntax Description ...
PowerShell Copiar Get-CMTSStepSetDynamicVariable [-TaskSequenceName] <String> [-StepName <String>] [-WhatIf] [-Confirm] [<CommonParameters>]DescriptionUse este cmdlet para obtener un objeto de paso de secuencia de tareas para una o varias instancias del paso Establecer variables dinámicas ....
PowerShell PS C:\>Get-HgsTrace-Target$VMhost,$Server-RunDiagnostics This command runs diagnostics on the targets stored in the $VMHost and $Server variables. Example 4: Diagnose the local host using hardware PowerShell PS C:\>Get-HgsTrace-RunDiagnostics-Diagnostic"Hardware" ...
Append daily PowerShell output to HTML file Append Date & Time to File name Append organisation name to AD display name Append static csv column to result set on export of data; Using Select-Object and Export-CSV append string to all strings in array Appending info to the telephone (notes)...
PowerShell Copy Get-ActiveSyncDeviceClass -Filter "DeviceType -eq 'WP'" This example returns a list of all Windows Phones.Example 2PowerShell Copy Get-ActiveSyncDeviceClass | group-object -Property DeviceType This example lists all device types within the organization along with a count of ...
PowerShell Copy Get-ActiveSyncDeviceClass -Filter "DeviceType -eq 'WP'" This example returns a list of all Windows Phones.Example 2PowerShell Copy Get-ActiveSyncDeviceClass | group-object -Property DeviceType This example lists all device types within the organization along with a count of ...
(x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;c:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program ...
This command gets all of the providers that write to the Application log. PowerShell Copy (Get-WinEvent -ListLog Application).ProviderNames .NET Runtime .NET Runtime Optimization Service Application Application Error Application Hang Application Management The Get-WinEvent cmdl...