r/PowerShell • u/CarrotBusiness2380 • 18h ago
r/PowerShell • u/AutoModerator • 17d 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!
r/PowerShell • u/AutoModerator • Oct 01 '26
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!
r/PowerShell • u/xXFl1ppyXx • 19h ago
Question Byte (Array) to Integer
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 • u/Suspicious_Rest4713 • 1d 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)
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 GraphprovisionedPlans, 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
-Autoswitch 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
ConcurrentQueuepolled by aDispatcherTimer. There's a Stop button (BeginStop()on the running pipeline) - Only
Microsoft.Graph.Authenticationis needed: everything goes throughInvoke-MgGraphRequestwith 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)
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 • u/sqloid • 6h ago
Question PowerShell rules for AI coding agent
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 • u/Regg42 • 1d ago
Question How to stop VSCode printing empty lines when Debugging/F10?
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 • u/AccomplishedMeet628 • 1d ago
News PS7ScriptDesk V10 - My custom PowerShell 7.x ISE
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
r/PowerShell • u/IggyTP • 1d ago
Question DisplayConfig script only works some of the time
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 }
}
}
ExitThis script works maybe 75% of the time and switches my displays correctly. The other 25% however, one of two problems will occur:
- 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.)
- 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 • u/michaelmsonne • 2d ago
Script Sharing GSAClientDiagnosticsToolkit v1.0.1 is here: small tweaks, new health checks and a few fixes
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 • u/ThanksViagra • 1d ago
Question Random PowerShell Wake-Ups
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 • u/BlueberriesTasteNice • 2d ago
Question How do I uninstall a PowerShell script?
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 • u/Incrediblecodeman • 4d ago
Question Good powershell profile tips
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 • u/Daniel_Mitchell24 • 4d ago
Question Automating STIG CKL comparisons with PowerShell
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 • u/karanikn • 6d ago
News Powershell collection for IT Admins and not only
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 • u/Arch1Frost • 4d ago
Question why is it allways starting on system32?! it should start on the desktop...
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 • u/stumper66 • 7d ago
Question PowerShell 7.7 - All users profile script location
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 • u/Unlikely_Tie1172 • 6d ago
Solved Using Exchange Custom Attributes for Groups Through the Microsoft Graph
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/
r/PowerShell • u/SoyBoy_64 • 5d ago
Script Sharing ADSearch - User/Computer comparison tool
This Active Directory toolkit offers user/computer OU comparisons using fuzzy Levenshtein matching to determine if the computer is in an OU that matches the user's OU. Designed for large enterprise IT audits/asset management of complex (2+ OU levels) AD environments
ADSearch/README.md at main · Contoso-Administrator/ADSearch
Edit: Made some edits based on everyone's kind words :)
r/PowerShell • u/michaelmsonne • 6d ago
Script Sharing Now its time - my new tool 'GSAClientDiagnosticsToolkit' is out!
I work Global Secure Access, the Product Team at Microsoft too, and I use it every day. Over time I got tired of manually checking the same things whenever a client wouldn't connect (DNS issues, certificates, stale forwarding profiles, proxies...). So what did I do? 🤔
I built a PowerShell module that runs them all in one go ofc! And the nice part is it's open source, Windows PowerShell 5.1+ (Windows only for now), but who knows whats come later 😉
And to be fair, this is not a weekend project. It is a collection of checks I have built up over time - on and off for almost a year - every time I (or someone in the community) ran into a new GSA problem and thought "this should be a check".
Original it started as a single connectivity script, and has since been converted to a proper module with a `Public`/`Private` structure, a Pester test suite, and 35 exported functions - all orchestrated by one command:
Invoke-GSAClientConnectivityCheck
And the good part is, it's open source and build in PowerShell!
What it can do:
> `Invoke-GSAClientConnectivityCheck` runs everything and prints a pass/warn/fail summary
> Local checks: service health, Entra device/PRT status, cached forwarding profile (registry + timestamp), proxy detection, Secure DNS, IPv6, event log, DNS/TLS/mTLS to the edge
> Private Access: checks whether a target FQDN/IP + port + protocol is allowed by the cached profile, and whether it actually goes through the tunnel (synthetic 6.6.x.x + private DNS resolver) and assignments
> mTLS auth certificate: check, backup, and a guarded repair (always backs up first and needs two confirmations before deleting)
> Graph-based tenant checks: forwarding profile assignment, Private Access app segments, and Intelligent Local Access private networks with public probe FQDNs/DNS servers. That last one can make GSA bypass Private Access traffic for users who were never on the corporate network
> Real-world edge cases: Cisco VPN split-DNS REFUSED lookups, home subnets overlapping Private Access IP rules, hosts-file overrides of the tenant DNS names
> It also lists the GSA service principals you should exclude in App Protection policies and checks whether they exist in your tenant
> ...and more. 35 exported functions, Pester tests, and every check can run on its own!
How to install you may think? 🤔
Install-Module GSAClientDiagnosticsToolkit -Scope CurrentUser -AllowPrerelease
or clone it from GitHub.
It's a pre-release, so I'd like to hear:
- What GSA problems have you hit that a check like this should catch?
- Anything that gives false positives in your environment?
Write-up with screenshots and more can you find on my blog: GSAClientDiagnosticsToolkit is here: a PowerShell module to find out why Global Secure Access isn't working on your device · Michael Morten Sonne | Microsoft MVP
(Disclosure: I'm the author. It's a free community project, not a Microsoft-supported tool)
#Microsoft #MVP #MVPBuzz #GSA #Community #Identity
r/PowerShell • u/Lost-Yesterday-5779 • 6d ago
Question I'm a sysadmin and I made a cartoon about our basement because therapy is expensive
Five IT people. One windowless basement. 14,000 users who keep breaking things.
I work in IT and started turning the stuff we all live through into a little animated sitcom. Episode 1, "The Ticket", is up now. If you've ever closed a ticket that said "it doesn't work" with zero other info, this one's for you.
The cast:
- Lasse – network (it's always DNS)
- Pia – support (has heard every excuse)
- Micke – sysadmin (has rebooted things you wouldn't believe)
- Kalle – security (trusts no one, especially McAfee)
- Svenne – hardware (has seen what's inside your laptop)
The channel is about 15 minutes old, so be gentle 😅
https://www.youtube.com/@TheITCrewToons
Which of your worst tickets should become an episode? I'm genuinely taking requests.
r/PowerShell • u/Weak-Fudge154 • 7d ago
Information I built a Cyberpunk 2077 style shell for Windows using PowerShell and WPF
Hey everyone,
I wanted to share a project I've been working on: Night City OS. It's a fully functional Windows shell replacement inspired by Cyberpunk 2077.
It's written entirely in PowerShell and WPF, and it uses WebView2 for the embedded Chromium browser and a built-in AI chat (DeepSeek).
Features:
- Custom WPF interface with neon/dark theme
- Built-in file manager and system monitoring
- Embedded browser (WebView2)
- AI chat integration
- Autostart and "replace desktop" modes
It's completely open-source. You can check it out here: https://github.com/kisllik/Cyberdeck
If you like it, you can support the project via the link in the README. Let me know what you think!
r/PowerShell • u/4r73m190r0s • 8d ago
Question PowerShell Editor Services on Linux, how to get completions that are Windows-specific?
For example, I'm not getting completions for Get-CimInstance and bunch of other Windows-specific modules.
r/PowerShell • u/Ultimate_Harrier • 9d ago
Question Importing specific rows from a .xslx-file to a .csv file
This is probably the most simple thing ever so apologies.
So I have an Excel worksheet and I want to import the data from specific rows, if column D in those rows has a certain value in it.
So using ImportExcel what I have is:
import-excel -path "filelocation" -WorksheetName "Worksheetname" | export-csv -path "exportlocation" -NoTypeInformation
What would be the missing bit to get the specific info I'm looking for? Again, I'm sorry for asking for what is probably a very simple solution.