Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
kurast3366yPowershell is very hard to deploy across machines you don't control as an admin.
If an user wants to use PS to improve his workflow, he is usually barred from it. -
@dontPanic A modern object oriented shell scripting language (sorry for the buzzwords).
Basically it allows automating every Windows task in a sane way (e.g. not using the raw Windows API, vbscript or command line utilities in batch from year 2000 or older). -
athlon173226y@sbiewald the problem is, CMD works much faster and doesn't get in the way that much like Power "whoops, can't run that script" Shell
-
@athlon Besides the initial startup time, what tasks do you do where the speed makes a difference?
Have you set the execution policy correctly - as other said - from an admin prompt? This should probably eliminate those "not allowed" errors. There are also countless ways to circumvent the execution policy. -
zymk11506y@athelon
Try executing this from an administrative powershell terminal:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
For those times you need to run something without worrying about the execution policy you can also run this the: bypass
Option instead of remotesigned
Sorry I meant to say if you are executing this command to run a ps1 file you can do this too:
ps > powershell.exe -ExecutionPolicy Bypass -Path “c:\path\to\script.ps1” -
zymk11506y@athlon I've been working with powershell a lot lately and have run into about every stupid fuckwit type issue you can imagine. I'd be happy to help out with anything that I've learned from banging my head against the wall if it can help prevent someone else from having to do the same thing. =D
-
athlon173226y@sbiewald I'm just complaining about initial start time. I admit it's a minor complain, but because of that small delay, I still prefer to use CMD - yes, it isn't as feature packed, yes it's not object oriented, but it is faster to open.
@zymk yeah I did that today. The weird part is just that the exact same script worked literally yesterday without changing a single bit. On exact same Windows 10 version. On exact same machine. It's not a super complicated script. It's literally just packing 4 files into the .zip archive and removing one .txt file (if exists) and a single folder (if exists) -
@athlon About the execution policy: The script location didn't change to a network drive? Windows behaves strangely from network shares sometimes...
-
So you have a slow computer and don’t understand how Windows security model works, remind me again what that has to do with PowerShell?
-
zymk11506y@athlon
You might want to check out ‘profiles’ in powershell. There’s like 4-5 different profiles powershell can load and you may need/want to run:
ps > $profile
to get the location of your user profile and then you can update that userprofile with that ExecutionPolicy so everytime you load a new powershell window from your machine as your user you’ll be able to run the scripts without issue
Related Rants
Christe on a bike, why would anyone sane use PowerShell? I can't even run my own fucking script, because "cannot be loaded because running scripts is disabled on this system". Even tho I used the same script file literally yesterday.
So I'm just gonna use single command to change it. Easy? Well fuck no! Because no one thought that implementing something like "sudo" would be a fantastic idea, so you have to jump between two separate instances of that piecie of shit. Not to mention it takes ages to even load it.
rant
windows
powershell