I posted a Power Shell snippet a while ago on bypassing the execution policy. More recently I needed to combine that with running a script with administrator permissions. I did a little exploring and found an article by Adam Dimech which contained this code which can be run from a batch file:
Change the highlighted section to your saved ps1 file and you can run that script escalated with…
Continue Reading Ian Grieve’s Article on their blog
Run escalated PowerShell script from a batch file
I posted a Power Shell snippet a while ago on bypassing the execution policy. More recently I needed to combine that with running a script with administrator permissions. I did a little exploring and found an article by Adam Dimech which contained this code which can be run from a batch file: Change the highlighted section to your saved ps1 file and you can run that script escalated with administrator permissions.
Blog Syndicated with Ian Grieve’s Permission
More About This Author
Array
- Dyn365GP1 May 2024In Microsoft Dynamics 365 Business Central (Administration), how do I… Understand the Approaches to Configuring a New Company
- Dyn365GP30 April 2024In Microsoft Dynamics 365 Business Central (Administration), how do I… Restore a Deleted Company
- Dyn365GP29 April 2024In Microsoft Dynamics 365 Business Central (Administration), how do I… Refresh an Environment
- Dyn365GP26 April 2024In Microsoft Dynamics 365 Business Central (Administration), how do I… Restore an Environment to a Point in Time