119,088 questions
Score of 0
1 answer
112 views
Updating Git for Windows unattended with PowerShell returns an error when run against remote servers
I maintain a lot of servers, and I am looking to auto-update Git for Windows on all of them periodically. There is a built-in way to do this with git update-git-for-windows -y.
This works great on the ...
Score of -3
0 answers
74 views
PowerShell works on cmd line, fails in system.d or crontab [closed]
When starting a HelloWorld.ps1 PS script this works perfectly on bash command line, but fails when started out of system.d or crontab with this error:
Couldn't find a valid ICU package installed on ...
Score of 2
1 answer
82 views
Setting Proxy Registry value via on PowerShell via a GPO
I am trying to set the proxy registry values via powershell deployed via a GPO as a logon script on my domain controller. The purpose is for all windows clients (7, 8 ,8.1 ,10 and 11) to have the ...
Score of 0
2 answers
151 views
PowerShell script with `-WhatIf` support [duplicate]
-WhatIf is a Common Parameter in PowerShell that describes the effect of the command, instead of executing the command.
How can I create a PowerShell script with -WhatIf support, so potentially ...
Score of -2
0 answers
83 views
Unable to load a .NET 10 dll with Powershell 5.1 [duplicate]
I recently changed the target framework of one of my assemblies from .NET Framework to .NET 10. Thereafter when I am trying to load that DLL from one of my PowerShell script using Octopus Deploy, it ...
Score of -1
1 answer
185 views
Powershell splitting string into chunks not working
I have the following multiline string:
Inside Magic Kingdom Park at @waltdisneyworld is a memorial next to the Mad Tea Party that thousands of guests unknowingly pass by every day.
Randy Pausch co-...
Score of -4
1 answer
177 views
How do you run a PowerShell script with admin level permissions, but not launching a subprocess with admin level permission?
I wrote a PowerShell script that:
Kills Windows Magnify (built-in app), aka:
just Magnify, process, if it is running;
Runs Magnify in lens mode;
Launches GOG's Skyrim Anniversary Edition mod pack ...
Score of 2
1 answer
109 views
Getting WebView2 Assembly load errors when calling Add-Type. Is it my code or the assembly?
On Windows 11 Pro, using PowerShell v5.1, I'm trying to create a WebView2 browser pop-up dialog.
Add_Type function Parameters:
$fullPath = "C:\Program Files (x86)\Windows Kits\10\Windows ...
Score of -1
0 answers
107 views
How to detect a button element on a webpage being clicked in Microsoft Edge via PowerShell
I got this URL for a PowerShell script from Copilot when I searched for how to detect a webpage's button element being clicked in a PowerShell script.
I'm running in Windows 11 Pro and PowerShell ...
Score of 1
2 answers
204 views
Powershell "You cannot run this script on the current system"
I'm trying to install unsigned programs with Install-Module. I understand the risks of doing so.
After reading the error message, I looked into Execution Policies and tried to update my local one (...
Score of 0
0 answers
136 views
Codex CLI Update Error - missing OSArchitecture property
I get this error on Codex CLI every time I try to update codex when a new version is available.
iex : The property 'OSArchitecture' cannot be found on this object. Verify that the property exists.
I ...
Score of 0
1 answer
163 views
Git clone over SSH hangs in WSL2 at expecting SSH2_MSG_KEX_ECDH_REPLY
I’m trying to clone a private GitHub repository over SSH from inside WSL2 (Ubuntu):
git clone [email protected]:username/repository.git
The command starts normally:
Cloning into 'repository'...
but ...
Score of 5
2 answers
202 views
Detect whether PowerShell scripts can be executed from Windows Batch
I have a Visual Studio project with a post-build event. Part of the post-build script executes a PowerShell script. I recently moved to a new computer, and the PS script failed with this error:
The ...
Score of 2
2 answers
167 views
PowerShell inconsistency?
ls * | ft length
ls * | ft {$_.length}
In the first statement the length of the subfolders in the current folder shows up as $null and in the second as 1. Can somebody please explain to me what the ...
Score of -1
1 answer
341 views
What is the equivalent Cmd.exe program for this PowerShell one-liner program?
I have a program (program.exe) that converts XML files to HTML files. I use the following PowerShell command to convert all XML files in a specified directory to HTML files:
Get-ChildItem -Path E:\...