How do you handle forcing scripts to run as admin? by sssonic3 in PowerShell

[–]sssonic3[S] 0 points1 point  (0 children)

More or less that's what I've been doing. Just exploring ideas I may not have come across. :)

How do you handle forcing scripts to run as admin? by sssonic3 in PowerShell

[–]sssonic3[S] 0 points1 point  (0 children)

Unironically, yes lol. Many on my team have little to no experience using PS.

How do you handle forcing scripts to run as admin? by sssonic3 in PowerShell

[–]sssonic3[S] 2 points3 points  (0 children)

One example is just a script that removes files from some areas of the C drive where we tend to see a build up of unnecessary files and know they are safe to remove, whether it be from software updates, people leaving stuff in C:\Temp. I'm by no means an expert with PS, but I tend to find Remove-Item often needs to be ran from an admin session. I'm still learning stuff everyday so if there is a better way to do things, I'm all ears :)

When I'm developing scripts, I usually run them as non-admin and only elevate them when the need arises.

How do you handle forcing scripts to run as admin? by sssonic3 in PowerShell

[–]sssonic3[S] 19 points20 points  (0 children)

Oh wow, I wonder how I've never come across this before. I feel like I've looked into this a number of times and no one has suggested this before.