powershell PowerShell:Get-Privilege

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell PowerShell:Get-Privilege相关的知识,希望对你有一定的参考价值。

<#
	.SYNOPSIS 
		Retrieve the privileges of the current user context.
	.DESCRIPTION
		Executes the WHOAMI command with the /PRIV and /FO CSV options to export the results to a format that is converted to a PowerShell object.
	.NOTES
#>
[CmdletBinding(SupportsShouldProcess=$True, DefaultParameterSetName="DefaultPS")]
param(
)

begin {
}

process {
	whoami /priv /fo csv | ConvertFrom-Csv | Select @{Name="Name";Expression={$_."Privilege Name"}},* -ExcludeProperty "Privilege Name" | Sort -Property Name
}

end {
}

以上是关于powershell PowerShell:Get-Privilege的主要内容,如果未能解决你的问题,请参考以下文章

powershell PowerShell:Get-Handles

powershell PowerShell:Get-MicrosoftUpdates

powershell PowerShell:Get-NetPrefixPolicy

powershell PowerShell:Get-FileHash

powershell PowerShell:Get-ComparableVersion

powershell PowerShell:Get-OSBitness