r/PowerShell • • 21d ago

Script Sharing What have you done with PowerShell this month?

19 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 • • Oct 01 '26

Script Sharing What have you done with PowerShell this month?

23 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 • • 2d ago

News Windows PowerShell 5.1 Deprecation

141 Upvotes

Windows PowerShell 5.1 is deprecated. It's no longer in active development. Windows PowerShell 5.1 is still part of Windows, and it's still supported. It will continue to receive security updates according to the lifecycle of each version of Windows. Scripts and tools that rely on it will continue to run.

Windows PowerShell 5.1 will be removed from a future version of Windows. Timing will be based on usage data and communicated in advance.

Microsoft recommends upgrading to PowerShell 7, the upgrade from Windows PowerShell 5.1. For more information, see Migrating from Windows PowerShell 5.1 to PowerShell 7.

Timeline

2026: Windows PowerShell 5.1 is deprecated. Windows Server 2025 and Windows 11, version 26H2 are the last versions of Windows to include PowerShell 5.1 enabled by default.
Next Version of Windows: Windows PowerShell 5.1 will be available as a Feature on Demand (FOD), enabled by default on new Windows installs.
Future Version of Windows: Not available.

https://support.microsoft.com/en-us/servicing/os/windows/docs/2026/11/kb5137172-windows-powershell-5-1-deprecation

At the moment there are many, many Windows management PowerShell modules built in to that aren’t supported in PowerShell 7 - they are either completely untested, or they only work via the (PowerShell 5.1 dependent) compatibility layer. Does this mean we can expect new native modules, or everything to just break? #notholdingmybreath

Affected modules:
- Domain Controller deployment (ADDSDeployment)
- ADFS
- AppLocker
- AppvClient
- BestPractices
- ClusterAwareUpdating
- ConfigCI
- DFSR
- DhcpServer
- FailoverClusters, FailoverClusterSet
- GroupPolicy
- Both IIS management modules (IISAdministration, WebAdministration)
- IpamServer
- iSCSI, IscsiTarget
- ISE
- Microsoft.PowerShell.ODataUtils
- MsDtc
- NetLldpAgent
- NetWNV
- NetworkController, NetworkControllerDiagnostics
- NetworkLoadBalancingClusters
- PersistentMemory
- PKI
- Provisioning
- PSDesiredStateConfiguration (partially supported)
- PSScheduledJob
- PSWorkflow, PSWorkflowUtility
- RemoteAccess
- RemoteDesktop
- ServerCore
- ServerManagerTasks
- SMS
- StorageBusCache
- StorageMigrationService
- StorageReplica
- SystemInsights
- TLS
- UpdateServices

EDIT: The following PowerShell modules are also currently Windows PowerShell 5.1 only:

- SharePoint Online Management Shell
- Power Platform admin modules
- Systems Center Operations Manager (SCOM)
- Systems Center Virtual Machine Manager (SCVMM)
- Entra Connect (Azure AD Sync)

https://learn.microsoft.com/en-us/powershell/windows/module-compatibility?view=windowsserver2025-ps

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_windows_powershell_compatibility?view=powershell-7.6


r/PowerShell • • 2d ago

Script Sharing A dock, desktop widget and falling snow for Windows, all in one PowerShell script (WPF + a bit of C#)

1 Upvotes

MacDesk is a macOS-style dock and desktop widget written in Windows PowerShell 5.1 with WPF. This winter it also got snow that settles on your windows.

Things that were fun or painful to get right:

- The snow overlay can't be a WPF window. WPF removes WS_EX_LAYERED from GPU-rendered windows, so a "transparent" overlay ends up eating every click on the desktop (I found out the hard way). It's now raw Win32 layered windows painted by hand with UpdateLayeredWindowIndirect, updating only the rectangles that changed.

- It runs on its own thread and paces frames with DwmFlush, which gave a steady 60 fps. A DispatcherTimer gave uneven 20-40 fps.

- Window tops come from EnumWindows plus DWMWA_EXTENDED_FRAME_BOUNDS, with z-order occlusion so snow only lands on visible edges.

- The C# is compiled at startup with Add-Type, so it's limited to C# 5.

- If the overlay ever loses click-through, a watchdog turns the snow off.

Repo: https://github.com/b33nthere/MacDesk

Feedback on the code is welcome, especially the WPF / Win32 parts.


r/PowerShell • • 3d ago

Script Sharing PowerShell Module Manager

27 Upvotes

Inspired by the WPF version that u/karanikn shared the other day, I've just published a PowerShell Module Manager tool of my own:

It has cmdlets to aid in understanding which modules you have installed where, including when you have multiple versions, updating them and removing redundant old versions.

It also has a TUI, which you can open with Show-ModuleManager (or it's alias: modman) which allows you to explore, upgrade and prune your modules through a console UI. Because it's a TUI it's cross platform. It also supports PSRemoting so you can use it to manage modules on a remote machine.

Get it from the PSGallery:

Install-Module ModuleManager

r/PowerShell • • 3d ago

Script Sharing Manufacturer Updates (Dell/HP)

20 Upvotes

A PowerShell script that detects whether a device is Dell or HP, installs the vendor's update tool if needed, then silently installs all available driver, firmware, and BIOS updates.

Contoso-Administrator/Manufacturer-Updates


r/PowerShell • • 3d ago

Script Sharing I built a Windows app in PowerShell + WPF that measures latency to 75 Azure and AWS regions and exports to Excel with native charts (no Excel needed)

5 Upvotes

Hi all. This is a side project I've been working on: Eureka_CloudSpeed, a portable Windows tool that measures latency from your machine to Azure and AWS regions, live.

Some things that may be interesting from a PowerShell point of view:

  • WPF UI loaded with XamlReader, with background runspaces and a DispatcherTimer so the window never freezes while 75 regions are being measured in parallel.
  • The measuring engine is C# compiled in memory with Add-Type. I write nothing to disk because Smart App Control blocks unsigned DLLs.
  • The .xlsx files are written by hand (OOXML), with native, editable charts, tables and color scales. No Excel or ImportExcel module required.
  • Power BI Desktop export (free version): a .pbids file, a star schema, DAX measures and Power Query.
  • Command-line mode for scheduled runs (-SinInterfaz).

It also shows the status of Azure, M365, AWS, GCP, GitHub and Cloudflare compared with its own DNS/TCP/HTTPS checks, plus VM prices, IP ranges and IP lookup.

Heads-up: the UI is in Spanish for now, and the .exe isn't code-signed yet (signing through SignPath Foundation is in progress). You can run it straight from source with the .cmd launcher.

MIT licensed: https://github.com/juanraul86/Eureka_CloudSpeed

Feedback on the code is very welcome, especially on the runspace handling.

AI disclosure: a large part of the code and of this post was written with an AI coding assistant (Claude Code) under my direction. I defined the features, reviewed the changes and tested it on my own machines and against real Azure and AWS accounts.


r/PowerShell • • 3d ago

Question RegEx help...

17 Upvotes

I have never been able to wrap my head around regex... I have no idea why... anyways... I'm just trying to get the string between 2 braces (curly brackets). Here's what I've mangled together googling up... One of the many regex checking tools online said this should work but.. it doesn't

$uninstallString = (Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -like "*jdk*" }).UninstalLString$uninstallString = (Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -like "*jdk*" }).UninstalLString
$pattern = '(?<={).+?(?=})'
[Regex]::($uninstallString,$pattern).Value

<#
$uninstallString outputs the below
MsiExec.exe /I{370E1F16-ED05-4958-A820-78CD32DD70D8}
#>

The above code actually outputs nothing...

My head is so frazzled I'm not sure where to begin with it

Any help, or a point in the right direction would be appreciated.


r/PowerShell • • 4d ago

News Powershell 7 is coming to Windows

Thumbnail devblogs.microsoft.com
401 Upvotes

r/PowerShell • • 4d ago

Question PowerShell rules for AI coding agent

4 Upvotes

We know that the default shell for AI coding agents is Bash/Python, but for people like me who use agents on Windows without WSL, I prefer to use PowerShell.

So I wrote these rules for AI coding agents to use PowerShell instead of Bash.

Do you think these rules are OK, or is there anything I might have missed?

# Global Rules

## Shell: PowerShell 7.x (`pwsh`) only

- ALWAYS set `shell_flavor: "powershell"` on `exec` (default is bash). Never use bash/sh/WSL/cmd; never nest shells (`bash -c`, `pwsh -Command`).
- Write PowerShell syntax. Use `workdir` instead of `cd ... &&`. Quote paths with spaces.
- Prefer native cmdlets (`Invoke-RestMethod`, `ConvertFrom-Json`, `Where-Object`, `Select-String`, `Get-ChildItem`, `Test-Path`, `Get-Content`) over `curl`, `jq`, `grep`, `ls`, `cat`, `test`.
- External tools (`git`, `mvn`, `docker`, `npm`) are fine; check `$LASTEXITCODE`.
- Bash → PowerShell: `VAR=x cmd` → `$env:VAR='x'; cmd`; `export` → `$env:`; heredoc → `@'...'@`; `/dev/null` → `$null`; escape char is backtick; single quotes = literal. Quote native args containing `,` or `.` (e.g. `"-Dtest=A,B"`).
- Complex logic: write a `.ps1` (`#Requires -Version 7.0`), never `.sh`.
- Use splatting for many parameters, `Write-Output` (not `Write-Host`), `-Encoding utf8` when writing files, `-LiteralPath` for paths with `[ ]`.
- Confirm with the user before destructive commands (`Remove-Item -Recurse -Force`); preview with `-WhatIf`.

## Token Economy

- Use dedicated `grep`, `find_file_by_name`, `read`, `edit` tools instead of shell for search/read/edit.
- Limit output: `Select-Object -First N`, `Get-Content -Tail N`, `Select-String -Pattern ... -List`/`-Context 0`. Never dump whole files or logs to the shell.
- Return only needed fields: `Select-Object Name,Length`, not full objects. Use `Format-List`/`Format-Table -AutoSize` only at the end and only when needed; avoid wide tables.
- Build/test output (`mvn`, `npm`, `docker`): add quiet flags (`mvn -q -B`, `--no-transfer-progress`, `npm --silent`), then show only failures/summary, e.g. `... 2>&1 | Select-String 'ERROR|FAIL|Tests run:' | Select-Object -Last 30`.
- Save long output to a temp file and read only the relevant lines; do not re-read files already read this session.
- Batch independent commands in one call; chain dependent ones with `&&` or `;`.
- Use `git diff --stat`, `git log --oneline -n 10`, `git status -sb` before full diffs.
- Be concise in replies: no restating the task, no summaries of unchanged code, no unrequested explanations.

r/PowerShell • • 5d ago

Script Sharing HybridScope – a WPF GUI that merges AD + Exchange on-prem + Microsoft 365 into one RVTools-style inventory (read-only, PS 5.1)

37 Upvotes

I'm a sysadmin in a hybrid environment (Exchange 2019 + AD + Microsoft 365) and every time someone asked "how many mailboxes are still on-prem, how big are they, who has MFA, which licenses are wasted?" I ended up exporting three CSVs from three consoles and merging them in Excel by hand.

So I built HybridScope: one window, three sources, one merged view per user.

What it does

  • Pulls users from Active Directory, mailboxes from Exchange on-prem (Get-Mailbox, Get-MailboxStatistics, Get-RemoteMailbox) and licenses / sign-ins / OneDrive / MFA from Microsoft Graph
  • Tells you where each mailbox really lives (ON-PREM / 365 / NO MAILBOX) based on Exchange and Graph provisionedPlans, not on mailbox size
  • Real MFA status: registered methods, default method, legacy per-user state
  • RVTools-style tabs: Overview per OU, Users, Mailboxes on-prem / 365, OneDrive, MFA, Tenant licenses, an "Attention" list (on-prem mailboxes to migrate, licensed users without MFA, licenses on disabled accounts, inactive accounts)
  • 5 infrastructure modes with one click: Full Cloud / Full Hybrid / Hybrid (365 + AD) / On-Prem (Exchange + AD) / AD only
  • Export to formatted XLSX (ImportExcel) or CSV, all tabs or just the filtered current tab
  • -Auto switch for scheduled reports with certificate auth + history tracking
  • English / Italian UI

Some implementation details you might find interesting

  • Windows PowerShell 5.1, single .ps1, WPF built from XAML
  • All the heavy lifting runs in a persistent background runspace, so the UI never freezes; log lines come back through a ConcurrentQueue polled by a DispatcherTimer. There's a Stop button (BeginStop() on the running pipeline)
  • Only Microsoft.Graph.Authentication is needed: everything goes through Invoke-MgGraphRequest with manual paging, no giant SDK install
  • Exchange via implicit remoting (Import-PSSession, Kerberos), works from non-domain-joined PCs with explicit credentials
  • Read-only: it never writes anything to AD, Exchange or the tenant

Repo: https://github.com/Thonno/hybridscope (MIT)

HybridScope - Active Directory, Exchange and Microsoft 365 user report (PowerShell)

Screenshots are in the README (sensitive data blurred).

Full disclosure: I wrote it with a lot of help from an AI assistant and tested it on our own environment, so I'm sure there are edge cases I haven't hit yet. Feedback, issues and PRs are very welcome, especially from people with different setups (multiple Exchange orgs, big tenants, cloud-only).


r/PowerShell • • 4d ago

Question Byte (Array) to Integer

9 Upvotes

Good evening,

I'm currently dabbling in ASN1 Encoding and I've run into an annoying issue. It seems I was lucky enough to somehow never have encountered this before:

How can I convert from a byte array to integer without writings logic for all the different cases that can happen

[BitConverter] ::ToInt32() needs at least a byte array with the size of 4. Furthermore, the other way around it will always at least spit out a byte array with size 4 even if the int is in the singlebyte range with the rest zeroed (this is especially annoying in conjunction with my ASN1 practice)

[Convert]::ToInt32 only works with single items but not arrays

ToByte Method needs a format which I can't seem to find anywhere. Google search is pretty much Full of the two convert Classes or some generic IFormat stuff but no list what the formats for the methods are

Is there anything that will give me an int (non array) if the byte array im converting from has only one Value (and vice versa)

Ah an while I'm at it:

Is there a way to set the default output type when doing bit manipulation?

I im at the point where I get more than mildly annoyed if I so much as read "significant bit" anywhere. Gimme unsigned


r/PowerShell • • 5d ago

News PS7ScriptDesk V10 - My custom PowerShell 7.x ISE

2 Upvotes

Hi All,

Once again, after addressing some user feedback, I have updated my app and added it to the Microsoft Store.

Please search for PS7 Script Desk and as always, keep posting any issues or upgrade requests. I really want to get to a polished everyday driver for the community.
if you have already installed it, there should be an auto-update function to take care of that for you.

If there is someone that can test the export to EXE and Create API functions, That would be great. I am testing as I go but since I am leveraging a 'lab' environment, I will never know if someone in a real world environment will be able to create and use it. I want to include only functions of value for now and add any bells and whistles later.

Regards,

-Ron

PS7ScriptDesk


r/PowerShell • • 5d ago

Question How to stop VSCode printing empty lines when Debugging/F10?

3 Upvotes

When debugging a powershell file on VSCode whenever i'm paused on a breakpoint and press F0 to jump to the next line it prints an empty line in terminal. How to disable this?


r/PowerShell • • 5d ago

Question DisplayConfig script only works some of the time

3 Upvotes

Hi! I was looking for a way to quickly disable my triple monitor setup from my desk and enable my TV in the living room and vice versa, and found out about PowerShell scripting using DisplayConfig. I have very rudimentary knowledge of coding (only took three years of classes in high school), and this is the script that I came up with:

$IsTVOn = Get-DisplayInfo | Where-Object DisplayName -like "LG TV SSCR2"
if ($IsTVOn -eq $null) {
    Exit
} else {
    $IsTVEnabled = Get-DisplayInfo | Where-Object DisplayName -like "LG TV SSCR2" | Select-Object -Property Active
    if ($IsTVEnabled -match "False") {
        Get-DisplayInfo | Where-Object DisplayName -match "LG TV SSCR2" | Select-Object -Property DisplayId | ForEach-Object -Process { Enable-Display $_.DisplayId }
        Get-DisplayInfo | Where-Object DisplayName -notlike "LG TV SSCR2" | Select-Object -Property DisplayId | ForEach-Object -Process { Disable-Display $_.DisplayId }
    } else {
        Get-DisplayInfo | Where-Object DisplayName -notlike "LG TV SSCR2" | Select-Object -Property DisplayId | ForEach-Object -Process { Enable-Display $_.DisplayId }
        Get-DisplayInfo | Where-Object DisplayName -match "LG TV SSCR2" | Select-Object -Property DisplayId | ForEach-Object -Process { Disable-Display $_.DisplayId }
    }
}
Exit

This script works maybe 75% of the time and switches my displays correctly. The other 25% however, one of two problems will occur:

  1. When switching from "couch mode" to "desk mode," the leftmost monitor will fail to re-enable. (I found that after switching to desk mode and turning the TV off via remote, the monitor will re-enable by itself.)
  2. Switching to desk mode will sometimes fail to disable the TV and still re-enable my monitors.

I also found that the script seems to have a higher chance of working correctly if ran from PowerShell ISE 5.1.

Something tells me it has something to do with the fact that nothing in my script switches my primary monitor between my main one and the TV, but I'm not sure. What am I missing here?

EDIT: Not sure if this will help but I'm running Windows 11, and my displays are:

  • ASUS XG27AQDMG (Primary Monitor)
  • AOC 24G2 (Right Monitor)
  • AOC 24G2S (Left Monitor)
  • LG C6 (TV)

r/PowerShell • • 6d ago

Script Sharing GSAClientDiagnosticsToolkit v1.0.1 is here: small tweaks, new health checks and a few fixes

10 Upvotes

GSAClientDiagnosticsToolkit v1.0.1 is out!

Just a few days after introducing my PowerShell diagnostics module for Microsoft Global Secure Access (GSA) to the community, the first update is here - and it's based straight on your feedback!

What's new:

  • 3 new checks: Hyper-V external virtual switch detection, Group Policy NRPT conflict detection (with automatic SYSVOL source-GPO lookup), and GSA Edge Diagnostics status (reading the client's own cached per-channel health result)
  • 2 smarter checks: the auth certificate check now cross-checks the exact CertCommonName the client expects, and the Secure DNS check now also covers Firefox
  • 2 real fixes: a default log path crash on non-writable folders, and a false failure in the Private DNS resolver check for tenants only using Enterprise Applications.

And a big thank you to everyone who tested, reported issues and gave input for this release 🙏

Get it:
🔗 PowerShell Gallery: https://www.powershellgallery.com/packages/GSAClientDiagnosticsToolkit
🔗 GitHub Releases: https://github.com/michaelmsonne/GSAClientDiagnosticsToolkit/releases
🔗 Full write-up with all the details: https://blog.sonnes.cloud/global-secure-access-client-diagnostics-toolkit-1-0-1-is-here/

Open source, free to use, and built from real troubleshooting scenarios - keep the feedback coming!

#Microsoft #PowerShell #Community #GlobalSecureAccess #GSA #Entra #Identity #Security #ZTNA #MVP #MVPBuzz


r/PowerShell • • 6d ago

Question Random PowerShell Wake-Ups

2 Upvotes

Sometimes around each time in the morning PC will wake itself up, seemingly run multiple "Provider Lifecycle" tasks in PowerShell with Event 600 affecting Provider Registry, Alias, Environment, FileSystem, Function, and Variable each separately with similar details such as referencing '$InboxIMEs' or '$InboxPattern, unsure if normal Microsoft function or something malicious, devious, sinister, or god forbid something EVIL masking using HKLM:\SOFTWARE\Microsoft\CTF\TIP\ as a cover, details screenshot below for the Registry event, thank you.

Details as raw text:

Provider "Registry" is Started. 

Details: 
ProviderName=Registry
NewProviderState=Started

SequenceNumber=1

HostName=ConsoleHost
HostVersion=5.1.19041.7802
HostId=5c297344-6579-40e5-8f84-29d6b7d2c436
HostApplication=powershell.exe -ExecutionPolicy Restricted -Command 
 $Res = 0
 $InboxIMEs = (@(
 '{0000897b-83df-4b96-be07-0fb58b01c4a4}','{03b5835f-f03c-411b-9ce2-aa23e1171e36}',
 '{531fdebf-9b4c-4a43-a2aa-960e8fcdc732}','{6a498709-e00b-4c45-a018-8f9e4081ae40}',
 '{7c472071-36a7-4709-88cc-859513e583a9}','{81d4e9c9-1d3b-41bc-9e6c-4b40bf79e35e}',
 '{81ea0a17-aa39-455b-ba20-ea79a8f98966}','{8613e14c-d0c0-4161-ac0f-1dd2563286bc}',
 '{a028ae76-01b1-46c2-99c4-acd9858ae02f}','{a1e2b86b-924a-4d43-80f6-8a820df7190f}',
 '{b115690a-ea02-48d5-a231-e3578d2fdf80}','{c2cb2cf0-af47-413e-9780-8bc3a3c16068}',
 '{dcbd6fa8-032f-11d3-b5b1-00c04fc324a1}','{e429b25a-e5d3-4d1f-9be3-0c608477e3a1}',
 '{f25e9f57-2fc8-4eb3-a41a-cce5f08541e6}','{fa445657-9379-11d6-b41a-00065b83ee53}'
 ) | ForEach-Object { [regex]::Escape($_) }) -join '|'
 $InboxPattern = 'TIP\\(?:' + $InboxIMEs + ')'
 $LanguageProfiles = Get-Item 'HKLM:\SOFTWARE\Microsoft\CTF\TIP\{????????-????-????-????-????????????}\LanguageProfile\0x*\{????????-????-????-????-????????????}' -EA SilentlyContinue
 foreach ($prof in @($LanguageProfiles)) {
 if ($prof.PSPath -match $InboxPattern) { continue }
 $pp = Get-ItemProperty $prof.PSPath -EA SilentlyContinue
 $hasEnable = ($pp.PSObject.Properties.Name -contains 'Enable')
 if ((-not $hasEnable) -or ($pp.Enable -eq 1)) {
 $Res = 1
 break
 }
 }
 Write-Host 'Final result:',$Res

EngineVersion=
RunspaceId=
PipelineId=
CommandName=
CommandType=
ScriptName=
CommandPath=
CommandLine=

r/PowerShell • • 6d ago

Question How do I uninstall a PowerShell script?

0 Upvotes

Hi, I'm a total newbie with coding/computers. I recently installed something in my PowerShell, it was supposed to run bulk downloads on my bookmarks for a fanfiction website. It didn't work, and I can't figure out how to uninstall it. I'm fairly sure deleting it won't uninstall it. Any help is appreciated.

If the information is needed, here is where I downloaded it from: https://github.com/nianeyna/ao3downloader


r/PowerShell • • 8d ago

Question Good powershell profile tips

82 Upvotes

I’ve been having way too much fun customizing my PowerShell profile lately. 😂
Here’s what I’ve got so far:
root — Prompts for my Domain Admin credentials and launches a new elevated PowerShell session.
Green errors — Because Don Jones taught me that errors don’t have to be angry red.
Custom prompt — Shows my current path and the time, so I can tell how long commands took.
save-clip — My homemade clipboard vault! Password-encrypts whatever’s on my clipboard and saves it to a file. Even works with images.
Admin indicator — Makes it obvious when I’m running elevated.
Extended scrollback — Because nothing hurts quite like scrolling up to find something important, only to discover PowerShell already ate it. 😭
record — My next addition! A one-word shortcut to start a PowerShell transcript, timestamp the log file, and record my session. Maybe a stoprecord companion too.
I’m starting to think my PowerShell profile is becoming its own operating system.
What other clever functions, shortcuts, or quality-of-life improvements have you all added to yours? I’m looking for ideas worth stealing. 😂


r/PowerShell • • 8d ago

Question Automating STIG CKL comparisons with PowerShell

8 Upvotes

I'm trying to automate of our monthly STIG review process.

The monthly STIG batch processing is already handled. What i'd like to automate next is comparing the new CKL files against a known good golden base and generating a report showing only the controls that changed.

The goal is to avoid manually opening large numbers of CKL files in STIG Viewer just to find a handful of differences.

I'm currently looking at parsing the CKL XML with PowerShell but before I build something from scratch I wanted to see if there are existing PowerShell modules or tool that can compare CKLs or generate useful diff reports.

Has anyone automated something similar? What approach or tooling worked for you?


r/PowerShell • • 10d ago

News Powershell collection for IT Admins and not only

282 Upvotes

Over the last few months, I’ve been working on a number of PowerShell projects and automation scripts. Most of them focus on system administration, Microsoft 365, networking, monitoring, and general IT automation tasks.

I’ve published several of them on my GitHub if anyone would like to take a look:

https://github.com/karanikn?tab=repositories

I’m always looking for ways to automate repetitive work and make day-to-day administration a little easier.

If you have any ideas for improvements, new features, or changes, I’d love to hear them. And if you happen to spot any bugs, issues, or areas that could be improved, I’d really appreciate your feedback when you have the time.


r/PowerShell • • 9d ago

Question why is it allways starting on system32?! it should start on the desktop...

0 Upvotes

here is the config:

{

"$help": "https://aka.ms/terminal-documentation",

"$schema": "https://aka.ms/terminal-profiles-schema",

"actions": [],

"alwaysShowNotificationIcon": true,

"centerOnLaunch": true,

"copyFormatting": "none",

"copyOnSelect": false,

"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",

"keybindings":

[

{

"id": "Terminal.CopyToClipboard",

"keys": "ctrl+c"

},

{

"id": "Terminal.FindText",

"keys": "ctrl+shift+f"

},

{

"id": "Terminal.PasteFromClipboard",

"keys": "ctrl+v"

},

{

"id": "Terminal.CloseWindow",

"keys": "ctrl+f"

},

{

"id": "Terminal.DuplicatePaneAuto",

"keys": "alt+shift+d"

},

{

"id": "Terminal.OpenSettingsUI",

"keys": "ctrl+m"

}

],

"launchMode": "focus",

"newTabMenu":

[

{

"type": "remainingProfiles"

}

],

"newTabPosition": "afterLastTab",

"profiles":

{

"defaults":

{

"adjustIndistinguishableColors": "indexed",

"antialiasingMode": "cleartype",

"colorScheme": "One Half Dark",

"experimental.retroTerminalEffect": false,

"font":

{

"face": "JetBrainsMono Nerd Font"

},

"opacity": 0,

"padding": "15",

"startingDirectory": "C:\\Users\\maxsu\\Desktop",

"useAcrylic": false

},

"list":

[

{

"backgroundImage": null,

"backgroundImageOpacity": 0.07,

"colorScheme": "Ottosson",

"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",

"font":

{

"face": "JetBrainsMono Nerd Font"

},

"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",

"hidden": false,

"name": "Windows PowerShell",

"opacity": 0,

"scrollbarState": "hidden",

"startingDirectory": "C:\\Users\\maxsu\\Desktop",

"useAcrylic": true

},

{

"commandline": "%SystemRoot%\\System32\\cmd.exe",

"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",

"hidden": false,

"name": "\u041a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430",

"opacity": 100,

"startingDirectory": "C:\\Users\\maxsu\\Desktop",

"useAcrylic": false

},

{

"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",

"hidden": false,

"name": "Azure Cloud Shell",

"source": "Windows.Terminal.Azure"

},

{

"guid": "{6cff44b8-d193-55cd-b6c4-1c4f7101be95}",

"hidden": false,

"name": "Developer Command Prompt for VS 2022",

"source": "Windows.Terminal.VisualStudio"

},

{

"guid": "{5e05125c-0fdd-503e-8586-c85e104b19de}",

"hidden": false,

"name": "Developer PowerShell for VS 2022",

"source": "Windows.Terminal.VisualStudio"

}

]

},

"rendering.graphicsAPI": "direct3d11",

"schemes":

[

{

"background": "#18181B",

"black": "#18181B",

"blue": "#E5E7EB",

"brightBlack": "#4B565C",

"brightBlue": "#E5E7EB",

"brightCyan": "#E5E7EB",

"brightGreen": "#E5E7EB",

"brightPurple": "#E5E7EB",

"brightRed": "#E5E7EB",

"brightWhite": "#E5E7EB",

"brightYellow": "#E5E7EB",

"cursorColor": "#E5E7EB",

"cyan": "#E5E7EB",

"foreground": "#E5E7EB",

"green": "#E5E7EB",

"name": "Monochrome",

"purple": "#E5E7EB",

"red": "#E5E7EB",

"selectionBackground": "#18181B",

"white": "#E5E7EB",

"yellow": "#E5E7EB"

}

],

"showTabsInTitlebar": true,

"tabSwitcherMode": "mru",

"tabWidthMode": "compact",

"theme": "system",

"themes":

[

{

"name": "Monochrome",

"tab":

{

"background": "#18181BFF",

"iconStyle": "default",

"showCloseButton": "always",

"unfocusedBackground": null

},

"tabRow":

{

"background": "#E6E9EFFF",

"unfocusedBackground": "#DCE0E8FF"

},

"window":

{

"applicationTheme": "light",

"experimental.rainbowFrame": false,

"frame": null,

"unfocusedFrame": null,

"useMica": false

}

}

],

"useAcrylicInTabRow": true

}


r/PowerShell • • 11d ago

Question PowerShell 7.7 - All users profile script location

81 Upvotes

Starting with PowerShell 7.7 it is now a windows app and if you install it with Add-AppxPackage, then it will live in "C:\Program Files\WindowsApps\Microsoft.PowerShell_7.7.0.0_x64__8wekyb3d8bbwe"

On previous versions I had profile.ps1 live in "C:\Program Files\PowerShell\7"
However not only do I suspect the bin directory will change with each new version, it is now read-only for everything except system, you can't put any files in there without hacking it with system privileges.
Where do they expect us to put all user scripts now?


r/PowerShell • • 10d ago

Solved Using Exchange Custom Attributes for Groups Through the Microsoft Graph

5 Upvotes

Microsoft has released limited Graph support for accessing Exchange custom attributes in groups synchronized from on-premises environments. Not every type of Entra group is available on-premises, so we’re really talking about distribution groups and security groups. In any case, real-only access to the fifteen custom attributes is available via Graph API and the Get-MgGroup cmdlet. Now it’s up to you to do something inventive with the information.

https://office365itpros.com/2026/11/12/custom-attributes-graph/