Welcome on my blog

We use cookies to ensure you get the best experience on our website.

Powershell – Uruchamianie skryptu z uprawnieniami Administrator

Autor: chmajster 16.11.2022

Komenda

$powershell_sc_location = Get-Location | select -ExpandProperty "Path";
$powershell_sc_location = Get-Item $MyInvocation.ScriptName;
$powershell_sc_name     = split-path $MyInvocation.PSCommandPath -Leaf;

# Print script name with path
Write-Host $powershell_sc_location;

$powershell_sc_location = "$powershell_sc_location ";

# Print script name
Write-Host $powershell_sc_name ;

# Run skrypt as Admin
Start-Process powershell -ArgumentList $powershell_sc_location -Verb RunAs;

Dodaj komentarz

Search
Categories
O Blogu

Cześć Podróżniku!

Ta strona ma nie być typowym poradnikiem w IT, Głównym jej cel to zapisanie krótkich notatek, które mogą się przydać w codziennym życiu podczas korzystania/konfiguracji różnych urządzeń np. Ustawienia DHCP na Routerze Cisco, Ustawieniu Karty sieciowej na Linuxie itp.

Buy me A coffee
[Empty]

Wszelkie prawa zastrzeżone