119,093 questions
Score of -1
2 answers
95 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
67 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
118 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
160 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
108 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
101 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
195 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
93 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
0 answers
146 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
191 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
162 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
333 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:\...
Score of 3
2 answers
205 views
Confusion about pipe ("|") character in an environment variable in different Windows CLI tools
I'm trying to declare an environment variable in Windows that can be used by any of the three CLI's that I use: CMD, Powershell, and git-bash. But I'm getting confusing behavior with the way the | is ...
Score of 6
1 answer
182 views
How can I connect to MgGraphs and Exchange Online in the same PowerShell session?
I have seen the suggestion to not access Exchange online as Admin but I will not be able to make the necessary changes to user mailboxes without logging into Exchange as admin. I've tried connecting ...
Score of 2
1 answer
89 views
Using PS, export users in the AD groups that have certain prefix and suffix
How would I export all of the users in the AD groups that start with prtr and end with -d using PowerShell?
Example:
prtr-fin1-d
prtr-int1-d
prtr-med1-d
I want to exclude groups that start with ...