Hello, fellow PowerShell Engineers! We have another great week of PowerShell content for you.
PowerShell Tip: Simplify JSON API Calls with Invoke-WebRequest
Instead of manually parsing JSON responses from REST APIs, use the -UseBasicParsing
parameter with ConvertFrom-Json
for cleaner code:
# Instead of this verbose approach:
$response = Invoke-WebRequest -Uri "https://api.example.com/users" -Method GET
$jsonContent = $response.Content | ConvertFrom-Json
# Use this streamlined version:
$users = (Invoke-WebRequest -Uri "https://api.example.com/users" -UseBasicParsing).Content | ConvertFrom-Json
# Or even better for POST requests with JSON body:
$body = @{ name = "John"; email = "john@example.com" } | ConvertTo-Json
$result = Invoke-WebRequest -Uri "https://api.example.com/users" -Method POST -Body $body -ContentType "application/json" -UseBasicParsing | ConvertFrom-Json
PowerShell Videos
Rob Pleau at PowerShell.org has a YouTube video titled "Stop Writing Insecure PowerShell... Seriously." In this video, Rob discusses how to write more secure PowerShell code using readily available, free tools.
Andrew sits down with Shannon Eldridge-Kuehn to talk about his journey from being a DJ to becoming a cloud engineer.
PowerShell Community News & Projects
Christophe Humbert put together a really cool Microsoft 365 Group Membership script called Common Groups. This PowerShell script automates the process of finding shared Microsoft 365 groups among multiple users by connecting to Microsoft Graph and analyzing group memberships. It takes a list of user IDs or email addresses as input, retrieves each user's group memberships, and identifies groups that all specified users have in common. The script offers flexible output options including console table display, CSV export, or HTML report generation with sortable/filterable tables, making it useful for administrators who need to quickly identify shared access permissions or collaboration groups across team members. It requires the Microsoft Graph PowerShell module and appropriate permissions (GroupMember.Read.All, User.Read.All) to function properly.
Check out the script here: https://github.com/ChristopheLux/PSPublic/blob/main/CommonGroups.ps1
Alex-wdy from Microsoft recently had this announcement from Build 2025, which focuses on significant quality, security, and user experience improvements for Azure CLI and Azure PowerShell. Key updates include new Long Term Support (LTS) options for Azure CLI (matching Azure PowerShell's existing LTS), a mandatory transition to SecureString
for sensitive data in Azure PowerShell, and easier installation via Microsoft Artifact Registry. User experience enhancements cover real-time progress bars, smarter output formatting, and JSON-based resource creation. The post also highlights improved Copilot integration for Azure CLI/PowerShell, with better accuracy and response quality.
Tony Redmond on Practical365, provides five crucial tips for writing better Microsoft Graph PowerShell scripts. He highlights common pitfalls such as failing to filter data, fetching excessive properties, using overly broad permissions, leaving beta code in production, and ignoring pagination. The core advice for efficient scripting includes server-side filtering, retrieving only necessary properties, adhering to the principle of least privilege, using production APIs, and always handling pagination.
Read here: Avoid The Five Big Errors in Graph PowerShell Scripts.
Harm Veenstra's blog post highlights the Polyglot extension for VSCode, which simplifies creating Jupyter notebooks with PowerShell code. This new method makes it easier to document and run scripts, offering multi-language support and variable sharing. The post also mentions a PowerShell module for generating notebooks from scripts, useful for interactive documentation and troubleshooting.
Alexander Holmeset on alexholmeset.blog, has a great blog post where he announces the preview release of Azure OpenAI Sora for Azure AI Foundry, enabling text-to-video generation. Holmeset provides a PowerShell script to automate video creation and download, serving as a non-Python alternative. The script handles sending prompts, monitoring job status, and downloading the final MP4 video. Users will need an Azure AI Foundry project with a deployed Sora model, along with their API key and endpoint.
Read here: Creating/downloading videos from Azure OpenAI Sora by PowerShell/API.
Przemyslaw Klys at Evotec.xyz has a blog post detailing significant enhancements to the PSWriteHTML PowerShell module, designed for creating professional HTML reports and dashboards. New features include New-HTMLInfoCard
for clear display of key metrics, improved New-HTMLSection
, New-HTMLPanel
, and New-HTMLContainer
cmdlets, and a versatile -Density
parameter for flexible layout (Spacious, Comfortable, Compact, Dense, VeryDense). The update also brings rich shadow customization options, allowing for various intensities, directions, and custom colors. These additions aim to simplify the creation of intuitive and visually appealing HTML reports that are also responsive across devices.
Read here: Enhanced Dashboards with PSWriteHTML – Introducing InfoCards and Density Options