Updateded to Show Message to run as administrator
Updateded to Show Message to run as administrator. When run without elevated below message would be shown. Which is clear to run as administrator .\set-dockernat-networkategory-to-private.ps1 : The script 'set-dockernat-networkategory-to-private.ps1' cannot be run because it contains a "#requires" statement for running as Administrator. The current Windows PowerShell session is not running as Administrator. Start Windows PowerShell by using the Run as Administrator option, and then try running the script again. At line:1 char:1 + .\set-dockernat-networkategory-to-private.ps1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (set-dockernat-n...-to-private.ps1:String) [], ScriptRequiresException + FullyQualifiedErrorId : ScriptRequiresElevation
This commit is contained in:
parent
7dd819c4b5
commit
896442a0bf
@ -1 +1,2 @@
|
||||
Get-NetConnectionProfile | Where-Object { $_.InterfaceAlias -match "(DockerNAT)" } | ForEach-Object { Set-NetConnectionProfile -InterfaceIndex $_.InterfaceIndex -NetworkCategory Private }
|
||||
#Requires -RunAsAdministrator
|
||||
Get-NetConnectionProfile | Where-Object { $_.InterfaceAlias -match "(DockerNAT)" } | ForEach-Object { Set-NetConnectionProfile -InterfaceIndex $_.InterfaceIndex -NetworkCategory Private }
|
||||
|
Loading…
x
Reference in New Issue
Block a user