VariablesToExport 類型: String[] '*' 指定模組匯出至呼叫端工作階段狀態的變數。 允許使用通配符字元。 根據預設,會匯出所有變數 ('*')。 您可以使用此金鑰來限制模組所匯出的變數。 呼叫端的會話狀態可以是全域會話狀態,或對於巢狀模組而言,另一個模組的會話狀態。 當您鏈結巢狀模組時,巢狀...
... Get-Command [[-Name] <System.String[]>] [[-ArgumentList] <System.Object[]>] [-All] [-CommandType {Alias | Function | Filter | Cmdlet | ExternalScript | Application | Script | Workflow | Configuration | All}] [-FullyQualifiedModule <Microsoft.PowerShell.Commands.ModuleSpecification[]...
PowerShell includes the following aliases forClear-Variable: All platforms: clv To delete a variable, along with its value, useRemove-VariableorRemove-Item. This cmdlet does not delete the values of variables that are set as constants or owned by the system, even if you use theForceparameter...
PowerShell $Cred=Get-CredentialInvoke-Command$s{Remove-Item.\Test*.ps1-Credential$using:Cred} 範圍using修飾詞是在 PowerShell 3.0 中引進的。 另請參閱 about_Variables about_Environment_Variables about_Functions about_Script_Blocks Start-ThreadJob...
{Write-Error"You must set the following environment variables"Write-Error"to test this script interactively."Write-Host'$Env:BUILD_SOURCESDIRECTORY - For example, enter something like:'Write-Host'$Env:BUILD_SOURCESDIRECTORY = "C:\code\Fabrikam\HelloWorld"'Write-Host'$Env:BUILD_BUILDNUMBER - For...
d+\.\d+\.\d+" # If not running on a build server, remind user to set environment variables for debugging if(-not ($Env:BUILD_SOURCESDIRECTORY -and $Env:BUILD_BUILDNUMBER)) { Write-Error "You must set the following environment variables" Write-Error "to test this script interactively....
Microsoft.PowerShell.Management模組已新增 Clear-RecycleBin Cmdlet,其可清空固定磁碟機的資源回收筒,包含外部磁碟機。 由於此 Cmdlet 的 ConfirmImpact 屬性設定為 ConfirmImpact.High,因此預設會提示您確認 Clear-RecycleBin 命令。 新的New-TemporaryFile Cmdlet 可讓您在進行指令碼處理時建立暫存檔案。 新的暫存檔...
Use-TransactionAdds the script block to the active transaction. Wait-EventWaits until a particular event is raised before continuing to run. Wait-JobSuppresses the command prompt until one or all of the Windows PowerShell background jobs running in the session are complete. ...
This function will return all variables not defined by PowerShell or by this function itself. The default is to return all user-created variables from the global scope, but you can also specify a scope such as script, local, or a number 0 through 5....
Each script runs in its own scope. The functions, variables, aliases, and drives that are created in the script exist only in the script scope. You cannot access these items or their values in the scope in which the script runs.