r/PowerShell 6d ago

Script Sharing What have you done with PowerShell this month?

Upvotes

A sticked post for the community to share their projects throughout the month.

Make sure to post a link to the code!


r/PowerShell 9h ago

Script Sharing I built a terminal time tracker (ps-sablier) that handles Pomodoro sessions, SQLite logs, and custom audio notifications without leaving PowerShell.

Upvotes

Hello everyone,

I stumbled upon a Go script that could display a progress bar on the terminal, which I found quite nice. At the same time, I was tired of using JavaScript programs that were certainly very complete, but far exceeded the use I wanted to make of them. I just need a global view of my work sessions and not get lost in unnecessary details. PowerShell was there, and I already had SQLite available in my terminal, inherited from an old Android project. In short, I found some ingredients in the fridge and thought it would be a good idea to bake a proper cake, especially since I was hungry. From this desire, this lightweight utility written in PowerShell was born. It allows you to track the time that passes and log your sessions, or if you feel like it, group them into Tasks without leaving the terminal (psmux tabs). The GIF doesn't show it, but the utility sends you a notification with a notification sound you can customize (for my part, I use the one from Splinter Cell, where he activates his night-vision goggles, [.wav format support only]).

(Sablier) in french = Hourglass 

Simple to use, it's available here: https://github.com/KNY00/ps-sablier

A feedback is always welcome.


r/PowerShell 2d ago

Question how can i learn powershell as a non coder?

Upvotes

I want to learn more about powershell, how can I use it in my normal day to day uses and out of my curiosity towards tech


r/PowerShell 1d ago

Question Chezmoi setup

Upvotes

Hi there.

I'm pretty new to dotfiles and trying to set up chezmoi on Windows 11. I'm not sure if my approach is alright, so maybe you can give me some tips or advice.

I used scoop to install all my programs and the config files are pretty scattered around. Some are in the scoop persist folder, some are in .config in my home directory, some are in %appdata% roaming...

Then i was thinking: wouldn't it be nice to have them all in .config and track them there with chezmoi. So i added the xdg_config_home variable to my pwsh profile (for the programs who accept that) and used symlinks and junctions (for the rest) to move all needed config files to the .config folder.

I'm not sure if this is a good approach. I would like to know how you guys are doing this.

cheers and thank you for reading.


r/PowerShell 2d ago

Script Sharing I built a free Windows tool to batch-print PDF/Word/TIFF with per-file page ranges

Upvotes

Hey all,

I got tired of manually printing dozens of documents one by one with different page ranges each time, so I built a small PowerShell-based tool (compiled to a standalone .exe, no install/admin rights needed) that lets you:

  • Queue up multiple PDF, Word (.doc/.docx), and TIFF files
  • Set a different page range per file (e.g. "1-3", "2", "1,5-8")
  • Reorder the queue before printing
  • Print them all in sequence to any installed printer

It's free, works on both x86 and x64 Windows, and uses PDFium/SkiaSharp for PDF rendering so it doesn't depend on having Adobe installed for PDFs specifically (Word docs still need Word installed, since it converts them to PDF first).

Download (installer): https://github.com/edgarchirinos/ColaImpresionECP/releases/latest

Full source code is in the repo if you want to see how it works or contribute: https://github.com/edgarchirinos/ColaImpresionECP

Happy to answer questions or take feature requests. It's donation-supported (optional button in the app), not selling anything.


r/PowerShell 1d ago

Script Sharing I built a PowerShell WinForms NIC Analyzer + Tuner with INF parsing, live validation, backup/verify/rollback and raw registry support

Upvotes

I built a Windows NIC analysis/tuning project almost entirely in PowerShell and thought this might be interesting from the PowerShell side of things.

GitHub:
https://github.com/N3jjj/Universal-NIC-Analyzer-Tuner-Realtek-Tested

The original idea was to build a NIC tuner around one specific adapter/driver combination.

While working on it, I realized that hardcoding a fixed list of registry tweaks around one NIC and one driver branch is not very scalable.

Different NICs, driver versions and hardware revisions can expose different INF parameters, registry values and advanced adapter properties.

So I rebuilt the idea around:

Detection first, tuning second.

The project is now split into two PowerShell WinForms tools.

Universal NIC Analyzer v1.0

The Analyzer is completely read-only.

Instead of assuming a predefined list of settings, it tries to determine what actually exists for the installed adapter and driver.

It collects things such as:

  • PCI hardware identity / VEN / DEV / REV
  • subsystem information
  • driver provider and version
  • driver service and binary
  • active INF section
  • INF SHA-256
  • driver SYS SHA-256
  • Get-NetAdapterAdvancedProperty settings
  • hidden or profile-commented INF parameters
  • registry-backed internal values
  • RSS / RSC / LSO information
  • Deep Analysis candidates

The Analyzer then exports a normalized JSON Portable Report.

That report deliberately contains no write instructions.

Universal NIC Tuner v1.0

The Tuner consumes the Portable Report, but does not blindly trust it.

Before allowing changes, it re-reads the live adapter and checks things such as:

VendorId
DeviceId
Revision
DriverModel
DriverVersion
INF SHA-256
Driver SYS SHA-256

If the live adapter or driver no longer matches the report, Apply stays locked.

I ended up implementing three separate write routes:

StandardAdvancedProperty
HiddenDriverRegistry
AdvancedRawRegistry

StandardAdvancedProperty is used for normal driver settings exposed through Windows advanced adapter properties.

HiddenDriverRegistry handles typed settings that exist in the active driver configuration but are not normally exposed.

AdvancedRawRegistry is an opt-in path for existing internal INF / registry values and Deep Analysis candidates.

For the registry-based routes, the existing live registry type is preserved.

Currently supported raw types are:

REG_SZ
REG_DWORD
REG_QWORD

DWORD and QWORD input can be entered as decimal or 0x hexadecimal values.

Transaction and safety model

A large part of the project ended up being about making writes recoverable instead of just making them possible.

Before Apply can run, the Tuner requires the relevant safety checks to pass:

Administrator privileges
exact live hardware/driver/hash match
verified backup
at least one proposed change
supported write route
valid proposed-value representation
no state drift
adapter restart route
final transaction integrity

The normal workflow is:

Settings
-> Preview Plan
-> Execution Model
-> Final Transaction
-> Apply
-> Restart adapter once
-> Read back changed values
-> Verify

A recovery journal is created before the first write.

If a write, adapter restart or post-write verification fails, the Tuner attempts to restore the original transaction state automatically.

The rollback itself is then verified as well.

There is also:

  • manual rollback of the last successful Apply
  • persistent verified backups
  • standalone backup restore
  • pre-restore safety snapshots
  • differential restore instead of blindly rewriting the complete registry key

One edge case I ran into was preserving DWORD values such as:

0xFFFFFFFF

because PowerShell/.NET may expose that as signed -1, while the backup format needs to preserve the actual unsigned 32-bit representation.

Advanced / undocumented values

The Advanced mode intentionally does not assume that an undocumented driver value is safe just because it can be discovered and written.

For those values, the Tuner only knows things such as:

the value exists
its current value
its registry type
where it was discovered
whether it can be written
whether the new value was read back successfully

It does not invent:

semantic meaning
recommended value
safe range
performance benefit

That distinction became important while parsing driver INF data.

Advanced raw values are therefore clearly marked as detected-only and require an additional warning before Apply.

The Tuner also does not create missing raw registry values.

Verified backup and recovery

A Verified Backup represents the exact adapter-class registry state at the time it was created.

The backup includes things such as:

Portable Report fingerprint
hardware identity
driver model/version
INF SHA-256
driver SYS SHA-256
adapter class-key path
registry values
registry types
registry-state SHA-256
backup SHA-256

After a successful Apply, that old backup normally becomes stale because the live state has changed.

For another transaction, a new Verified Backup of the new state is required.

Standalone restore is independent of the normal transaction rollback.

Before restoring a backup, the Tuner creates a temporary safety copy of the current state.

Restore is differential, so only backed-up values that actually differ are rewritten.

Testing so far

v1.0 has currently been tested end-to-end on:

Realtek PCIe 2.5GbE Family Controller
RTL8125D / REV_0C
Realtek NetAdapterCx driver family

The following paths have been tested successfully:

  • StandardAdvancedProperty Apply / Verify / Rollback
  • HiddenDriverRegistry Apply / Verify / Rollback
  • AdvancedRawRegistry Apply / Verify / Rollback
  • mixed-route multi-setting batches
  • one adapter restart after the complete batch
  • automatic rollback after intentionally injecting a failure after the first successful write
  • Verified Backup creation and verification
  • standalone Verified Backup restore
  • pre-restore safety recovery

Intel, Broadcom, Marvell and other NIC vendors are currently untested.

The Analyzer is designed to discover other adapters, but I do not want to claim universal compatibility until the write / verify / rollback behavior has actually been tested on those driver families.

Why PowerShell?

I originally expected this to remain a relatively small script, but PowerShell ended up being surprisingly useful for tying together:

  • CIM/WMI
  • NetAdapter cmdlets
  • registry access
  • INF parsing
  • file hashing
  • JSON serialization
  • WinForms
  • process elevation
  • transaction logic
  • recovery and rollback handling

At this point it has become as much a PowerShell project as a NIC tuning project.

I would be very interested in feedback on the PowerShell side in particular:

  • structure / architecture
  • WinForms approach
  • registry handling
  • transaction design
  • error handling
  • things that could be made more idiomatic
  • compatibility issues on different Windows / PowerShell versions

And if anyone here has an Intel, Broadcom, Marvell or another Realtek NIC and wants to test the read-only Analyzer, that would also be useful.I built a PowerShell WinForms NIC Analyzer + Tuner with INF parsing, live validation, backup/verify/rollback and raw registry support


r/PowerShell 1d ago

Script Sharing Microsoft Entra Object Inspector

Upvotes

Hello everyone, hope you are doing well!

I’m sharing Entra Object Inspector, an open-source, read-only Microsoft Entra assessment tool, and I’m looking for critical technical feedback from people who work with Entra, Microsoft Graph, and PowerShell.

I’m fully aware that mature products and open-source projects already exist with much broader scope. This project was not intended to compete with them; it started as a focused engineering exercise around deterministic collection, evidence-backed findings, offline processing, and transparent reporting.

AI was used heavily during development, including for a large portion of the PowerShell implementation. I think that is worth being explicit about. The important part for me was not generating code quickly, but governing and validating what was produced: researching Microsoft Graph behavior and permissions, reviewing the architecture repeatedly, building Pester coverage, testing against a dedicated Entra tenant, inspecting exported evidence, and treating failures as engineering problems rather than accepting generated output at face value.

Some of the issues encountered included Graph batching changing PowerShell object shapes and breaking relationship processing, service principals being omitted from the v1.0 group-members endpoint, hidden-membership completeness, evidence/provenance reconciliation, keeping Graph activity strictly inside snapshot collection, release-integrity validation, and a significant offline export performance bottleneck. Each of those resulted in targeted fixes and regression tests.

The current public release passes 276 Pester tests and has been exercised end-to-end against a test tenant.

What I’m most interested in now is independent review: incorrect assumptions, edge cases, questionable PowerShell patterns, Graph behavior I may have missed, usability problems, or anything else that would make the tool more technically credible.

If you find the project useful or think it’s worth following, I’d also appreciate a star on the repository! it helps me understand whether there’s interest in continuing to develop it.

GitHub: https://github.com/0xDarknightHacks/EntraObjectInspector


r/PowerShell 2d ago

Question How do you make a cleanup script prove a file belongs to it before deletion?

Upvotes

A path and age check are not enough when a cleanup directory can also contain files created by people or other jobs. I am considering an ownership manifest written at creation time, with a run ID, normalized path, size, and hash, then requiring every field to match before deletion. The command would also use PowerShell's normal confirmation path:

\[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')\]
param(\[string\] $Root, \[string\] $ManifestPath)

if ($PSCmdlet.ShouldProcess($candidate.FullName, 'Remove owned artifact')) {
    Remove-Item -LiteralPath $candidate.FullName
}

What additional safeguards belong around this pattern? Possibilities include rejecting paths outside the resolved root, refusing reparse points, failing closed when the manifest is incomplete, logging the file identity before and after validation, and separating discovery from deletion so the candidate list can be reviewed with `-WhatIf`. How do you avoid a time-of-check/time-of-use gap if another process can replace a file between validation and removal?


r/PowerShell 3d ago

Script Sharing PowerShell installer for .NET, Visual C++ and DirectX that bundles no binaries and resolves every download from Microsoft at run time

Upvotes

Rebuilt an old batch project of mine in PowerShell. It installs the .NET SDKs, the Visual C++ redistributables (current v14 plus the final 2005-2013 ones) and the June 2010 DirectX runtimes. Nothing is bundled and there are no hardcoded download URLs, so it locates everything on Microsoft's own hosts every run, then verifies each file before it executes.

Every discovery page and every payload URL goes through a check like this before anything gets fetched:

function Test-AllowedMicrosoftDiscoveryUri {
    [CmdletBinding()]
    [OutputType([bool])]
    param(
        [Parameter(Mandatory = $true)]
        [string]$Uri
    )

    try {
        $parsedUri = [uri]$Uri
        if (-not $parsedUri.IsAbsoluteUri) { return $false }
        if ($parsedUri.Scheme -cne 'https') { return $false }
        if ($parsedUri.Port -ne 443) { return $false }
        if (-not [string]::IsNullOrEmpty($parsedUri.UserInfo)) { return $false }
        return $parsedUri.DnsSafeHost -match $script:AllowedMicrosoftDiscoveryHostPattern
    }
    catch {
        return $false
    }
}

Discovery pages and payloads use two separate host allowlists, so allowing a docs host never authorizes an executable coming from it. curl's reported effective URL gets checked the same way after redirects.

Verification depends on what Microsoft actually publishes. The .NET SDKs have a SHA-512 in the release metadata. The final 2005-2013 and DirectX packages never change, so those are pinned to SHA-256 values I checked by hand. The rolling v14 redistributable has no published hash at all, so that one gets Authenticode plus a version floor read out of the signed file. Nothing installs until the whole selected set has resolved, and a file that fails verification gets deleted even if you asked to keep the downloads.

Windows PowerShell 5.1 compatible, uses pwsh if it's in PATH. Source and usage notes:

slyfox1186/msft-visual-c-and-directx-offline-installer


r/PowerShell 3d ago

Question Filtering and cost-effective ways to grab user data

Upvotes

Hey y'all.

I've been tasked with rewriting our current mailbox script and was wondering the best way to approach in regards to filtering user data.

Our current script gets the userdata by grabbing a user list, only filtering for enabled users and where the emailaddress attribute has the expected domain. We're migrating our onboarding process to a new system, so the domain part is not too relevant. But, since the way our users are categorized is changing, we have to rewrite things so that the mailbox configuration happens based on licensing state rather than OU.

This is where the filtering part comes in on my end. I'm thinking that the general process is like this, in no specific order:

  1. Grab all licensed users from AD group membership using Get-ADGroupMember

  2. Use Get-ADUser to grab the user objects, including specific parameters (proxyAddress, targetAddress, etc..)

  3. Filter the users where ProxyAddress does not contain anything pertaining to SMTP, to effectively find the users that have not been configured.

However, I'm curious as to whether it would be more effective time wise to do the filtering based on licensed user data, and gradually filter with foreach loops into new variables, or if it's smarter to start by just grabbing the entire catalogue with Get-ADUser -Filter *, grabbing only the licensed users, then filtering as imagined.

For reference, the difference is about 800 more users if I were to do the mass grab approach. I've been working with the idea that the group-based method is smarter, but at the same time I'm unsure if there's a massive overhead on the DCs associated with the fact that I'm piping the group member data into Get-ADUser. I'm, relatively speaking, new to PS and scripting (couple years of experience), so any pointers would be awesome!


r/PowerShell 4d ago

Question Recurring script maintenance

Upvotes

I'd honestly pay someone else to keep my voice scripts alive if it meant I never had to touch them again after a Windows update. Am I just lazy or is maintaining ur own automation actually the worst part of the whole thing?


r/PowerShell 5d ago

Information Python through PowerShell text colors are hard to read

Upvotes

Posting because I'm probably not the first person to lose ~4 hours trying to get to the bottom of this. My issue was: I was running python through a PowerShell window and the color of the text made error messages very hard to read.

In short: Download Windows Terminal and use that. You'll still be running PowerShell, it will just be inside a Windows Terminal window. The colors will be readable. Yes, its silly how there is now a 3rd way of running a terminal in Windows (Command Prompt, PowerShell, Windows Terminal).

So far as I know, python uses the colors that PowerShell defines for different kinds of text. I haven't yet found a way to successfully change all the text color categories in a basic PowerShell window.

  • Right clicking the top of the window and going to properties only lets you change the color of the basic text. not the problematic red and blue that is hard to read.
  • Changing the registry values at Computer\HKEY_CURRENT_USER\Console for ColorTable00 through ColorTable15 didn't change the colors used by PowerShell
  • There was an official program called color tool for changing the colors, but it appears it was last updated in 2019 and its .exe file failed to run on my Windows 10 computer.
  • I don't know if there is/isn't a way to redefine what colors python itself tries to print stuff.

If someone does know a working non-Windows Terminal way to fix ALL of PowerShell's/Python's hard to read text colors I'd be happy to hear it in the comments.


r/PowerShell 5d ago

Question Check for App updates on home PC

Upvotes

Afternoon,

I am trying to write a script that will let me know about updates to the apps installed on my home PC.

I saw on a Sysadmin thread about https://eucpilots.com/evergreen/ and thought it would be as simple as reading all of the installed apps and then querying each one like this:

$reg = @(

'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
)
GP $reg -EA 0|?{$_.DisplayName -ne $null} | Find-EvergreenApp $_.DisplayName

However when testing, the Evergreen is not expecting the App name to have spaces, so is my only option to split the string and put an asterisk at the end of the first section?

PS C:\Windows\System32> Find-EvergreenApp Telegram
Name            Application      Link
----            -----------      ----
TelegramDesktop Telegram Desktop https://desktop.telegram.org/

r/PowerShell 6d ago

Script Sharing Remixing Music with RoughDraft and PowerShell

Upvotes

This weekend I figured out how to remix music with PowerShell, RoughDraft, and ffmpeg.

Sample + Filter.

Rinse & Repeat.

RoughDraft + ffmpeg makes this all pretty easy.

Step 1 - Get Your Sample Source

RoughDraft includes an extension for yt-dlp. This can download media from almost anywhere. Just browse to a site with a song, set a $SongUrl variable, and download

Get-Media -MediaUrl $MediaUrl

Step 2 - Sample a Section

You can sample a section of audio or video with the -AudioTrim and -Trim filters. If we want the first few seconds of a song, we can use the AudioTrim filter, like so:

$sample = Edit-Media $song -AudioTrim -TrimStart "00:00:00" -TrimEnd "00:00:05"

Step 3 - Filter

ffmpeg is full of filters. There are hundreds of them, and RoughDraft supports a fair number.

Suppose we want to make our sample Vibrato. We can just use Edit-Media -Vibrato

$sample | Edit-Media -Vibrato

Or we could change the -PitchFactor, making it sound slower or faster while keeping the tempo intact.

$sample | Edit-Media -PitchFactor 0.81

Or we could use an Audio Compressor, with a short attack and release and a makeup to make the sounds louder

$sample | Edit-Media -Compressor -CompressorAttack 5 -CompressorRelease 10 -CompressorMakeup 2.5

Rinse and Repeat

The possibilities are endless. ffmpeg is an audio/video production tool of truly unparalleled capability.

All of that power is in your shell, in a format that's far easier to read and understand than direct filtergraph syntax. Edit-Media currently has a whopping 682 parameters to mix and match, all supporting tab completion.

This makes it easy to iterate and innovate. It took just about an hour after figuring this out to make my first little remix, just by sampling/filtering/rinsing/repeating.

The latest RoughDraft release includes a bunch of new audio filters to help assist and more will keep on coming with every release.

Hope this helps & Have Fun!


r/PowerShell 5d ago

Script Sharing Tooling with Claude and pwsh

Upvotes

Hey all!

I was hoping you’d could inspire me please! I currently work in a desktop/infra role in a finance company and was wondering if anyone had any cool tooling they created using Claude code? I really lack in coming up with ideas so just curious as to what other people have done and yeah, honestly I’d like to try and see if that could work for us!

I’m talking like automation for JML, dashboards, alerting, tools to help the team, tools that we can use for users to fix quick issues?

I realise I’d just be taking your ideas but I can’t really come up with anything myself!

Thanks!


r/PowerShell 6d ago

Question Add Date Taken as prefix to filename

Upvotes

I need some help. I have lots of photos (IMG_xxxx.jpg), and I would like to change the filenames using this convention (yyyymmdd_IMG_xxxx.jpg). This is the command line I am using in PowerShell:

Get-ChildItem -File | Rename-Item -NewName { $_.LastWriteTime.ToString("yyyyMMdd_") + $_.Name }

This seemed to work great until I realized the last write time didn't match the date taken. I want to use the date taken from the EXIF field.

I have found the GetDetailsOf command and know that Date Taken is the 12th property. How can I use this in a command line prompt in PowerShell?

Assumptions for my specifics:

  • all files are .jpg with Date Taken data
  • all files are in the current folder
  • renamed files will replace original in the current folder

This way, I don't have to worry about writing a script to determine path names or renaming to a different folder.

The code provided above works perfectly if the date I wanted was the last write time. Is there an easy way to modify this to use Date Taken instead?

TIA


r/PowerShell 6d ago

News No Homebrew Cask for Powershell

Upvotes

Homebrew removed the official powershell cask because the official Microsoft .pkg installer repeatedly failed macOS Gatekeeper checks. Homebrew moved everyone to a community-built formula instead, enforcing their policy to disable casks that fail Gatekeeper.

While the original removal aligned with Homebrew's policy, the underlying signing issue is resolved. Microsoft’s official macOS .pkg (tested on version 7.6.5) is now signed with a Developer ID Installer certificate (Microsoft Corporation, team ID UBF8T346G9) and fully notarized by Apple.

This alternative cask installs Microsoft's official, unmodified release file. Unlike the community formula, this package includes the embedded .NET runtime, requiring no extra dependencies.

Installation:

sh brew install --cask darkn3rd/tools/powershell-pkg


r/PowerShell 7d ago

Script Sharing I built MonitorAutoSwitch - automatically moves my laptop display to the correct side of my monitor (home vs office) based on my public IP

Upvotes

The problem: at home my laptop sits to the right of my ultrawide, at the office it sits to the left of the monitor. Windows kept getting confused after docking, so every arrival was alt-tabbing into Display Settings and dragging rectangles around.

What it does: a small PowerShell tool that detects where I am via my public IP and repositions the laptop display on the correct side of the main monitor. Triggers on logon, wake from sleep and display connect, plus a once-a-minute display-count watcher. Comes with a WinForms setup wizard, a system tray toggle, and a per-user installer (no admin rights, everything lives in %LOCALAPPDATA% and Task Scheduler).

The bug that took months: the first version stored absolute coordinates (X=5120) and randomly failed with DISP_CHANGE_FAILED (-1) from ChangeDisplaySettingsEx. Root cause turned out to be two-fold: the monitor sometimes runs at a non-native resolution, and a non-DPI-aware PowerShell process sees scaled coordinates - so the target position landed outside the desktop. The fix: store only "left" or "right" + a Y offset, compute the real X from the live display widths on every run, and opt the process into per-monitor DPI awareness via SetProcessDpiAwarenessContext. Also worth knowing: Windows can hand out high device numbers like \.\DISPLAY13, so don't enumerate only DISPLAY1-9.

GitHub (MIT): https://github.com/dimitrihilverda/MonitorAutoSwitch

Full disclosure: built in pair-programming style with Claude - the design decisions and months of debugging pain are mine, a good chunk of the typing was not. Feedback on the Win32 interop is very welcome.


r/PowerShell 7d ago

Question Manifest required modules not auto-importing in 5.1

Upvotes

Hello. I'm genuinely stumped, to the point where I'm about to abandon this side project altogether

I have a test module I'm creating using a manifest file, Template.psd1. The module depends on these other module files I created:

```

Modules that must be imported into the global environment prior to importing this module

RequiredModules = @(     'Control\ControlMessaging.psm1'     , 'Control\ControlChecklist.psm1'     , 'Control\ControlPrompt.psm1' ) ```

The are present in the subfolder "Control", which is in the same folder as the manifest and PSM1 files.

When I execute Import-Module in powershell 7.4, the module loads without bitching.

When I execute in 5.1, I get an error

Import-Module : The specified module 'Control\ControlMessaging.psm1' was not loaded because no valid module file was found in any module directory.

According to the documentation, this should be kosher: about_Module_Manifests It should auto import those modules, but it's not working.

I do need this to run in both 5 and 7. Any ideas?


r/PowerShell 7d ago

News Running a Regular Check for New Graph Permissions

Upvotes

Use PowerShell to Check for New Graph Permissions with a View to Updating Permissions Used by Apps.

After Microsoft released some new Graph permissions, thoughts turned to how to discover new permissions after they are released. Code is the best way to perform automatic checks, and this article explains how to use PowerShell to check a last known set (stored in SharePoint Online) against the current set. Any variations are reported to administrators via email.

https://office365itpros.com/2026/08/31/new-graph-permissions-check/


r/PowerShell 8d ago

Solved Transcript 5.1 Unexpected behaviour

Upvotes

Probably SOLVED:

  1. A previous

    Unlock-SecretVault

killed the transcribing

It spawns a subprocess for the credential management and when its done it sends exit code back to host which killed my transcribing by design.

3h gone

Hi,

when i am in a 5.1 shell and start a controller.ps1 script:

C:\User> C:\PSR\Controller.ps1 -TargetScript C:\Jobs\..

The Controller script uses Start-Transcript to capture the output of a $TargetScript

however. When I start the controller.ps1 script as shown here my currently forced error (Get-ADUser -xzyisks) appears in the log.

When i start

powershell.exe -File Controller.ps1 -TargetScript C:\Jobs\..

it suddenly stops capturing the invocation error output. (Expected:

A parameter cannot be found that matches parameter name 'xzyisks'.)

ai suggested some transcript buffer stuff but non of it worked.

this is the important code block:

# execute binary or script
    if ($Executable) {
        & $Executable $TargetScript
    } elseif ($Config) {
        & $TargetScript -Config $Config
    } else {
        & $TargetScript
    }
    Write-Output "execution of $TargetScript completed successfully"


    #endregion main


} catch {


    # store error so finally can dispatch the mail after the transcript is finalized
    $TerminatingError = $_
    # write the error into the transcript while it is still open
    $Host.UI.WriteLine("[ERROR] $($TerminatingError.Exception.Message)")
    try   { Stop-Transcript | Out-Null }
    catch [System.InvalidOperationException] {}


} finally {


    # transcript is already closed on error paths — only close on success path
    try   { Stop-Transcript | Out-Null }
    catch [System.InvalidOperationException] {}

Can someone explain on high level what happens..

Thanks

EDIT:

My main question is:

C:\User> C:\PSR\Controller.ps1 -TargetScript C:\Jobs\..
vs
powershell.exe -File Controller.ps1 -TargetScript C:\Jobs\..

when using start transcript..


r/PowerShell 8d ago

Solved Warning: ISESteroids Update is malicious

Upvotes

When I launched ISESteroids (Start-Steroids) I clicked update. Chrome notified me that the website was not-safe dummy here found the run website anyway and the Avast nightmare began ... 5 popup windows that my computer had 5 virus's , anti-virus not installed, blah blah blah .. Shutdown chrome, cleared my cookies, %temp% directory.. these popups just kept reappearing if I closed one.

reboot doesn't fix anything.. nothing in task manager helps narrow down what's launching even with chrome closed... sysinternals autoruns no help. real help.

While I built a new Veeam Agent install usb to potentially restore from yesterday (3 hour process) I started poking around in chrome and in the extensions I found something I didn't recognize and deleted it.. rebooted the computer and now its back to normal without restoring from backup.


r/PowerShell 9d ago

Script Sharing Built an open-source Windows diagnostic tool in PowerShell/WPF for my thesis — feedback welcome!

Upvotes

Hey everyone,

I'm currently working on my IT Bachelor’s Thesis and building Fercero USB Tool — an open-source, multithreaded Windows diagnostic and repair utility (PowerShell + WPF Dark Mode GUI).

It's still a work in progress, but current features include:

  • Hardware Scan: OS/CPU/RAM info, VRAM, and S.M.A.R.T. disk health.
  • System Repair: DISM/SFC scans, Windows Update cache reset, TCP/IP & DNS flushes.
  • Error Lookup: Integrated database for Device Manager codes (1–54) & critical system logs.

Since this is actively in development, I’d love some code reviews, testing, and feedback from the community!

https://github.com/SvetozarA00/Fercero-USB-Tool.git


r/PowerShell 9d ago

Question PrivateKey Test

Upvotes

Greetings

Is it possible to check if a private key is either RSA or ECDsa without trying to import them into their cng-objects catching the error?

I'm thinking of something like how

[X509Certificate2].GetContent($Import)

Is available for certificates

Neither the cng-objects nor the certificateextensions provide methods to test for the proper type


r/PowerShell 9d ago

Question PowerShell 7 ISE - A real conversation

Upvotes

Hi Everyone,

I think I need to have a reset on the way I introduced myself and my goal.

I am new to reddit and pretty much the entire open source community. I am an old school COBOL developer from the early 80's. I also know Visual Basic (about 15 years) and C# (about 4). I work on mainframes and z/OS on distributed systems (Linux). I maintain distributed apps for clients and sometimes on the mainframe. Not so much the mainframe anymore.

I use PowerShell every day. My shop uses PowerShell every day. We have 1000's of scripts, all written in 5.x that are years old.

They are not complex scripts, we don't have an Admin running a server farm or anything like that. They are just scripts that we use to make our jobs easier. Scanning files for codepages, finding Dupes using Hashes, things like that. When we run them, we use the old PowerShell ISE. We are used to it. It's easy, it looks good and it makes changing and running the script a smooth effortless event. The only issue is, that our shop has been slowly making us move away from 5.x to 7.x. This has been going on for years. I'm not happy because I lose my clean, crisp, no headache comfortable ISE. Yes, I said comfortable. I like it. We all do (at my shop). I tried to use the PowerShell plugin for VS Code. I did not like it. I really did not. So about a year or so ago, I decided to code my own. My goal was simple. I wanted to make a Daily Driver ISE for PS 7. Yes, I am going to share it with my co-workers once its finished and yes, I can and have asked a few of them to help me test it. I have gotten some good feedback from them. Not quite what I needed though. We are a simple shop, we do not do anything overly complicated and my co-workers are less than impressed with what I have shown them so far. It was buggy and did not have the feel of the ISE GUI. I felt that maybe if I turned to the PowerShell community for help, I could improve things. Actually make an App that we could use daily and transition from 5.x to 7.x without a blink.

I still want that.

I should not have started out asking if anyone still used the old ISE. That was the wrong approach, I acknowledge that. I should have just told you all my goal and left it at that.

I'm not asking anyone to jump on my bandwagon. My goal is simple, make something of value to more than just myself.

All I'm asking is, can you help me make it better.

If this post crosses a line, that crossing was unintentional. Let me know and I will walk away.

Regards,

-Ron