Forum Discussion
fhoext
Nov 24, 2023Copper Contributor
update powershell - script doesn't work anymore
Dear coll, HELP ME! I am a dummy powershell user; please, don't feed me with 10 line of code. I have a simple script, replacing some text in a coda file; I made it with notepad++ It runs for ...
Nov 27, 2023
You could capture the error with an extra line at the top with Start-Transcript c:\temp\log.txt and a Stop-Transcript at the end. Run the script, and check the c:\temp\log.txt afterward...
- fhoextNov 28, 2023Copper ContributorDear,
I got a hint from IT support. It looks like Microsoft has blocked standard all script :
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): a
Supplies !
let's try this one and see what happens.- Nov 29, 2023Any update?
- fhoextNov 29, 2023Copper Contributor
Sorry, I forgot to post my last reply.
Thanks for all support; we are up & running.
The script works as before, it was the security settings who blocked all.
KR,
FHO
- Nov 28, 2023Suppose you run a script like "pwsh,exe c:\scripts\script.ps1". That could be the case. You could add the -ExecutionPolicy bypass parameter, which would be "pwsh,exe c:\scripts\script.ps1 -ExecutionPolicy bypass" If you run it in a Terminal window, just use "Set-ExecutionPolicy Bypass" or Unrestricted.
You could get this warning:
"Set-ExecutionPolicy: PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of Bypass. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information please see "Get-Help Set-ExecutionPolicy".
That means that there is a policy configured for you system...