How do I run powershell scripts without admin rights?

前端 未结 5 706
再見小時候
再見小時候 2021-01-31 22:50

If I try to change the execution policy, I get a message that says I can\'t modify the registry because I\'m not an administrator.

It seems like this should be possible,

5条回答
  •  被撕碎了的回忆
    2021-01-31 23:12

    The third technique I've found elsewhere on the internet is to use

    powershell.exe -EncodedCommand XXXXXXX

    where XXXXXXX is the result of

    $code = {
         #powershell script goes here.
        }
    }
    
    [convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($code))
    

    Ref: http://dmitrysotnikov.wordpress.com/2008/06/27/powershell-script-in-a-bat-file/

提交回复
热议问题