<#
.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 {
}