119,241 questions
0
votes
0
answers
18
views
Compress-Archive recent changes to functionality? [closed]
Has there been recent changes to the compress-archive functionality in Powershell? I have some scripts that I have run monthly for years but lately they seem to run at what feels like an order of ...
3
votes
1
answer
46
views
Credential Use With New-PSSession for SSH
I am writing a Powershell 7 script that connects from a Windows 10 device to multiple Linux hosts via SSH. I want to enter the credentials once using Get-Credentials, however when I run the script, I ...
3
votes
1
answer
61
views
PowerShell Get-ADUser Published Certificates Import Error
I'm looking for some help with pulling certificate information from Active Directory. When I'm troubleshooting accounts, it can take a while to manually check each individual settings. One of the ...
-2
votes
0
answers
93
views
Why is this action not shown in the audit logs? [closed]
I'm trying to audit a user's actions in an MS Exchange Online shared mailbox. I'm not having any luck with my search results. In testing, I've deleted email from a mailbox and my Search-...
2
votes
2
answers
84
views
How can I prevent Windows PowerShell from breaking my bun/npm commands
I have a custom script in my package.json that commits the working tree, bumps the version of my npm package, and pushes it to the remote.
{
"scripts": {
"bump": "git ...
1
vote
0
answers
94
views
PowerShell cannot find pnpm (ObjectNotFound) while CMD works fine; [closed]
I am encountering a strange environment issue where pnpm is accessible and works perfectly in Windows CMD, but PowerShell (PS) fails to recognize it as a command.
Environment:
OS: Windows 10/11
Node....
1
vote
2
answers
81
views
Using wmic command with a comma in password
I need to use the script
$HOSTNAME = "host"
$PASSWORD = "password contains a comma,"
wmic /node:$HOSTNAME /user:"$HOSTNAME\\admin" /password:"\`"$PASSWORD\`&...
11
votes
2
answers
392
views
How do I stabilise Sort-Object in PowerShell 5.1?
I've noticed that the Sort-Object sort algorithm is not stable.
# v5.1.26100.7462
1..20 | Sort-Object { $_ % 2 } -Descending
1
3
17
5
7
15
9
19
11
13
18
16
14
10
8
6
4
2
12
20
I've looked at the ...
4
votes
1
answer
108
views
Can I defer the execution of a pipeline assignment
Apparently I broke my Permutations cmdlet without noticing it...
The cmdlet is supposed to generate permutations of a given set. Be aware that the number of permutations grows rapidly (factorial) ...
0
votes
1
answer
89
views
Exporting PowerBI reports using PowerShell and Service Principals
I'm trying to use a powershell script and service principal to export PowerBl reports. If I use my user, the download happens without issues. When I use the service principal, I get the following ...
0
votes
1
answer
103
views
Disable Exclusive Control in Audio Settings via Powershell script
So I'm trying to write a script to CLI disable the Take exclusive control setting in Windows 11. I can reliably pull the ID of the device, I can route it to a variable but the problem comes when I try ...
0
votes
0
answers
87
views
I cannot register PSGallery with correct source location [closed]
I have PowerShell 7.5.4, when I run below command
Get-PSRepository
Name InstallationPolicy SourceLocation
---- ------------------ --------------
...
1
vote
4
answers
150
views
Invoking tar.exe from PowerShell, can't input any more commands
I'm new to CLI and trying to use it instead of GUI options to get better at it.
Trying to extract a .gz archived pdf, but after running a command to see what happens it seems I can't input anything ...
0
votes
0
answers
59
views
How to prevent PowerShell command in Batch from displaying return value? [duplicate]
Here is a minimal working example which turns off all screens:
@echo off
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam,...
1
vote
2
answers
104
views
PowerShell variable not outputting property
below my $IP variable doesn't output value of the .name property, and it just shows:
" is Proxied via Cloudflare" instead of "example.com is Proxied via Cloudflare"
$URLs = Get-...