How Can I Run a PowerShell Script as an Executable for a Non-Techie Deployment Team?

0
0
Asked By TechSavvy91 On

Hey everyone! I'm a beginner with PowerShell and have been struggling for weeks to get a PSWindowsUpdate script to work in my deployment process. Given the complexities of my environment, we've decided to drop the script into C:Temp and have the deployment team run it after deployment. The catch is that most of these team members are students, and expecting them to launch Powershell.exe as admin, adjust the execution policy, navigate directories, and run the script is a bit much, especially with a bunch of new devices set to deploy soon.

So, I'm wondering if there's a way to create this script as an executable that they can run with admin privileges? Also, is it feasible for someone new to this to learn how to do this in just a few days? What kind of resources or skills would I need to look into? The script already includes the execution policy that works fine during the task sequence, yet I'm having issues with the Get-WindowsUpdate command failing with error code 0x80248007 afterwards. Any help or suggestions would be greatly appreciated! Thanks!

3 Answers

Answered By ScripterJoe92 On

One option is to add a step in your deployment process to create a scheduled task that runs the PSWindowsUpdate script with elevated permissions. This way, the team won’t need to handle it manually.

CuriousCoder42 -

I tried that, but something in our setup is blocking the Get-WindowsUpdate command during the task sequence. It runs fine after the image is completed, but not during.

Answered By QuickFixGeek On

Since you’re placing the script in the same directory each time, you could just create a shortcut for it. That should only take a few minutes, and you can easily set it up to run as admin. You can check PowerShell parameters with: powershell /?

Answered By CodeNinja007 On

Have you checked out PS2EXE? It's pretty straightforward and converts your script into an executable. But I can't guarantee it will fix your execution policy issue. Worth a shot though!

TechSavvy91 -

I’m looking into that! I'm curious if running the script outside of a PowerShell window will allow the Set-ExecutionPolicy in the script to work.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.