“if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("Administrators")) { Start-Process powershell.exe "-File `"$PSCommandPath`"" -Verb RunAs; exit }”

reboot_inreboot_in のブックマーク 2022/12/12 11:50

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

【PowerShell】PowerShellを管理者権限で実行したい!ソースの先頭に埋め込むだけで自動で管理者権限に昇格するスクリプト!

    やりたいこと ●PowerShellスクリプトファイル(.ps1ファイル)を右クリックで「PowerShellで実行」したときに、自動的に管理者権限として実行する。 ※もちろん、バッチファイル(.bat形式)のファイルなどからその...

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう