New
#1
running a script from a batch file
I have a batch file that I use to install multiple pieces of software on new computers coming into our office. I have been manually starting up a PowerShell script and running it but I know there is a better way to do this.
There are a couple of scripts that I would like to see working in the installation batch file. For all my other commands in the batch file, they run fine without having to run As Administrator.
This is the cleanup script that I run at the end of the installation
https://raw.githubusercontent.com/Sy...pDebloater.ps1
Currently, I copy this script to the C:\Temp folder and rename it Clean.ps1
Then I launch PowerShell in Administrator mode and run it. All manual
The closest that I can come to running it is with the following command in my batch file
Powershell.exe -noprofile -ExecutionPolicy Bypass -file C:\Temp\Clean.ps1
But it doesn't run correctly. It's not being run as the administrator.
Can anyone help me with this?