$cmds = @{ Name = 'Restart-Service'; Parameters = @{ Name = 'Name'; ValidateSet = 'wuauserv', 'Spooler' }},@{ Name = 'Get-Service'; Parameters = @{ Name = 'Name'; ValidateSet = 'wuauserv', 'Spooler' }}
New-PSSessionConfigurationFile -SessionType Empty -ModulesToImport Microsoft.PowerShell.Management -VisibleCmdlets $cmds -Path .\GetService.pssc -RunAsVirtualAccount
Register-PSSessionConfiguration -Name GetService -Path .\GetService.pssc
Set-PSSessionConfiguration -Name GetService -ShowSecurityDescriptorUI -Force
No comments:
Post a Comment