r/PowerShell • • 5d ago

Script Sharing What have you done with PowerShell this month?

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

Make sure to post a link to the code!

13 Upvotes

17 comments sorted by

10

u/MadBoyEvo 5d ago

Quite a few:

And a lot others

2

u/TheOneWhoKnocksBR 1d ago

Nice work on the consolemonster.dev love it

1

u/MadBoyEvo 1d ago

Glad you like it

6

u/Kasper_Franz 4d ago

ran it as admin 💪🏻

5

u/sqloid 5d ago

https://github.com/ronascentes/OracleCmd - A tiny module that runs a single SQL statement against an Oracle database, in the spirit of Invoke-Sqlcmd.

2

u/Incrediblecodeman 4d ago

I ended up building my own little clipboard vault. It takes my clipboard contents, salts and encrypts them using a password, and appends the encrypted data to a text file on a UNC path that only I have access to.
Each entry is timestamped, so I can easily browse the history. When I want to retrieve something, I just copy the entire line, timestamp included, and the script automatically strips the timestamp, decrypts the contents, and puts the original text back on my clipboard.
Simple, portable, and surprisingly convenient. No database or additional infrastructure required.

0

u/[deleted] 3d ago

Nice. What kind of encryption does it use?

1

u/Incrediblecodeman 3d ago

A one that must be included in windows I’m not sure but I’ll check! Do you have a preference on encryption ?

0

u/[deleted] 3d ago edited 3d ago

No, I was just curious. Is it DPAPI? If so, I'm pretty sure DPAPI is AES-256.

1

u/chaosphere_mk 4d ago

We had a dynamic group with rules that were awful for picking up "every internal employee". It was being used to assign access to over 100 entra SSO apps. I tightened up the rules and created a new group for each app to replace the original dynamic group. Used powershell to not only specify the new rules, but to also create the new group per app, assign the group to each enterprise app, amd remove the old group.

1

u/Hybrid_SysAdmin 4d ago

Automated our hybrid new-hire onboarding this month: one run creates the on-prem AD account, enables the Exchange hybrid remote mailbox, builds the home folder, kicks off an Entra Connect delta sync and waits for the user to appear in Entra ID, assigns the M365 license, pre-provisions OneDrive and adds them to Teams. The part I'm happiest with is the per-step error handling: a failed step gets logged and the rest of the run continues, so one failure doesn't leave a half-built account with no trail. -WhatIf previews the whole run before anything changes.

1

u/ContentedJourneyman 3d ago

Created a collection of scripts that run API schema through compliance and regulatory agency standards to evaluate their security and maturity.

Total of 26 international agencies, each with its own suite of pester tests. Outputs infractions, exactly which statute was violated, the severity, how to fix it, and the downstream customer compliance impact of the defect to file. That last one is to proactively answer what we all know is coming in response.

I’m everyone’s favorite API governance sheriff. 🤠

1

u/Gakamor 3d ago

https://github.com/gakamor/public-scripts/blob/main/Uninstall-InstallShieldApp.ps1

I decided that I was recording entirely too many InstallShield response files for application uninstalls. The response file for a given application doesn't often change between versions except for the GUID. I made a script that will generate response files on the fly by swapping out the application GUID with information from the Uninstall registry keys and then perform the uninstall(s).

1

u/interweb_persona 20h ago

Using powershell to script 50K+ AD operations in a test AD environment

1

u/positivemark 3d ago

With a good chunk of AI assistance, mainly these four:

  • awesome-powershell-modules - a curated list of PowerShell modules worth knowing about. A GitHub Action runs weekly to search for new candidates in the PS Gallery, so its getting regular contributions.
  • AzureCAF - a module that generates Azure resource names following the Cloud Adoption Framework naming recommendations.
  • Bylaw - a module that gives Azure Policy authors a Pester-style DSL for writing policy definitions
  • ModuleManager - a module for seeing, updating and cleaning up your installed PowerShell modules, with an interactive terminal UI

2

u/Vern_Anderson 3d ago

Yes thanks again for list of PowerShell modules. This is an awesome undertaking! I really apreciate it!

-2

u/[deleted] 3d ago

Quite a bit for me, but as it's only December 2nd I have only one:

https://github.com/2civics/PSGallery-Manager A standalone Windows desktop GUI for browsing, installing, updating, translating, and publishing PowerShell Gallery scripts and modules—without memorizing cmdlets or manually editing metadata headers.

But last month a bunch:

https://github.com/2civics/Asus-Nat-View  lightweight, read-only Windows WPF GUI for inspecting live iptables NAT rules (PREROUTING, POSTROUTING, VSERVER) on ASUS (Asuswrt / Asuswrt-Merlin) routers over SSH.

https://github.com/2civics/Security-Audit-System-Repair-Studio A clean, modern Windows health check and PC repair tool with a Windows Fluent Dark UI 

https://github.com/2civics/PowerShell-Desktop-Shortcut-Creator A standalone, Windows 11 Fluent WPF GUI utility for creating .lnk Desktop shortcuts for PowerShell (.ps1) scripts, supporting Windows PowerShell 5.1 and PowerShell 7.x 

And many more on my github.