AliasesToExport = @() # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in...
$process=Start-Process-FilePath"你的可执行文件路径"-ArgumentList"参数列表(如果有)"-NoNewWindow-PassThru-Wait # 获取 main() 函数的返回值 $exitCode=$process.ExitCode # 输出返回值 Write-Output"程序退出代码:$exitCode" 样例输出: PSD:\>$process=Start-Process-FilePath"./a.exe" PSD:\>$exitCo...
| SuccessAudit | Warning}] [-Index <System.Int32[]>] [-Message <System.String>] [-Newest <System.Int32>] [-Source <System.String[]>] [-UserName <System.String[]>] [<CommonParameters>] Get-EventLog [-AsString] [-ComputerName <System.String[]>] [-List] [<CommonParameters>] .....
$private:pVar='Private variable'Get-VariablepVar |Format-List* 使用範圍修飾詞會將privateOptions屬性設定為Private。 Output Name : pVar Description : Value : Private variable Visibility : Public Module : ModuleName : Options : Private Attributes : {} ...
列出所有分区 list partition Get-Partition 查看分区的详细信息 detail partition Get-Partition -DiskNumber <磁盘编号> 创建一个带有驱动器号的分区 create partition primary New-Partition -DiskNumber <磁盘编号> -Size <大小> -AssignDriveLetter 创建一个不带驱动器号的分区 create partition primary noerr New...
files count 20 通过重定向创建脚本 如果想要执行的脚本不是很长,我们甚至可以直接在控制台中要执行的语句重定向给一个脚本文件。 PSE:>'"Hello,World!"'>MyScript.ps1PSE:>./MyScript.ps1Hello,World! 这样有个缺点,就是您的代码必须放在闭合的引号中。这样的书写方式一旦在脚本内部也有引号时,是一件很痛苦的...
Command to fetch a list of particular job title Command to find out office bit version for remote computers Command to goto start of script Command to retrieve response header information when using Invoke-Restmethod Command Window Stuck In Insert Mode Compare 2 files and get line numbers Compare...
gwmi win32_service | where {$_.StartMode -ne “Disabled”} | select name,startname | format-list 结果有点像这个示例:复制 name : AcrSch2Svc startname : LocalSystem name : Adobe LM Service startname : LocalSystem Format-Wide cmdlet 会生成一个多栏的列表,默认情况下为每个对象的第一个属性。
Set-SPOListVersionPolicy Sets the version policy setting on the document library. Set-SPOMigrationPackageAzureSource Cmdlet to create Azure containers, upload migration package files into the appropriate containers and snapshot the uploaded content. Set-SPOMultiGeoCompanyAllowedDataLocation Adds a mul...
Select-String [-Culture <String>] [-Pattern] <String[]> [-Path] <String[]> [-SimpleMatch] [-CaseSensitive] [-Quiet] [-List] [-NoEmphasis] [-Include <String[]>] [-Exclude <String[]>] [-NotMatch] [-AllMatches] [-Encoding <Encoding>] [-Context <Int32[]>] [<CommonParameters>]...