Skip Navigation

Search

PowerShell Weekly for September 6, 2024

Announcements!

  • Scriptember 2024 \ A month-long celebration of PowerShell and its vibrant community

Blogs, Articles, and Posts

  • New in Windows Terminal: Restore buffers, code snippets, scratchpad and regex \ Windows Terminal unveiled a range of noteworthy features in versions 1.21 and 1.22 Preview, including the capacity to retrieve previous sessions' output buffer upon startup, store code snippets for reuse within the console, and utilize a scratchpad for crafting intricate commands.
  • PowerShell: Calculate the total size of Files \ In this post I will show how to use PowerShell to calculate the total size of all files. This will be a short post but maybe a very helpful one.
  • Transferring Reusable PowerShell Objects Between Microsoft 365 Tenants \ People often need to transfer objects or code between Microsoft 365 tenants. When it comes to dealing with objects, the Microsoft Graph PowerShell SDK's ToJsonString method is very useful. The method outputs a string containing JSON content, but only for object properties that have a value. This makes the much easier to use the output as the basis for a template object or as the payload body to create an object in another tenant.
  • Get List Item Count in SharePoint Online Using PowerShell \ In organizations, SharePoint lists are essential for organizing and managing various data, from tracking tasks to managing customer information and inventory. These lists not only streamline collaboration but also ensure that data is easily accessible and well-structured.
  • Practical PowerShell Series: Part 6 \ The practicalities of producing PowerShell output and generating logging are other essential scripting elements. No administrator likes to stare at a blank screen, wondering if the command just entered is functioning or not.
  • Configuring PowerShell settings using Intune or Group Policy \ Every Windows device has PowerShell installed by default. (Sadly, it's still only version 5, not version 7.) However, you want to configure the devices' security and log settings. In this blog post, I will show you how to do that using Microsoft Intune or Group Policy.
  • Taming My ADHD with Obsidian and PowerShell \ Alleviating my ADHD headaches with Obsidian. Periodic Notes and Templater extensions save the day by reminding me of the next step towards my larger goals.
  • 5 Reasons you should be using PSReadLine \ Get up to speed and use PSReadLine more often - in his first article for us, author Jeffery Hicks provides his 5 reasons why he recommends using PSReadLine.

Books, Media, and Learning Resources

  • Mastering Time in PowerShell: Measure statistical properties within time spans with PSDates [OC] \ Unlock the power of time manipulation in PowerShell with the Group-TimeSpan and Measure-TimeSpan cmdlets from the PSDates module! In this video, we'll dive deep into how you can group data by specific time spans and measure statistical properties like sum, average, maximum, and minimum within those groups. Whether you're looking to analyze logs, monitor system performance, or perform data analysis, these cmdlets offer powerful tools to streamline your workflows and enhance your data manipulation skills in PowerShell. Watch now to become a master of time-based data analysis!
  • Making Microservices with Docker and PowerShell \ The Pacific PowerShell User Group talks about making Microservices with Docker and PowerShell

Community

  • Being a Lazy Administrator with Bradley Wyatt \ In this episode of the PowerShell Podcast, I had the pleasure of chatting with Bradley Wyatt, also known as the Lazy Administrator. We explored his inspiring journey from college dropout to becoming a 5x Microsoft MVP and how he transformed his personal knowledge base into a globally recognized blog that serves as a vital resource for IT professionals. Bradley shares the lessons he’s learned along the way, his passion for automation, and the impact of his work on the PowerShell community.
  • Inside IT Automation - E11 \ Bruno Buyck: Learning PowerShell with Lego

Events

  • Scriptember Live Stream Episode 1 \ Scheduled for Sep 11, 2024. In this live stream, we'll talk about how to have fun with PowerShell while improving IT automation tasks and processes.

Check out psweekly.dowst.dev for all past editions as well as a searchable archive.

0

PowerShell Weekly for July 26, 2024

Announcements!

Blogs, Articles, and Posts

  • Extract LAPS Passwords and BitLocker Keys from Active Directory \ The below PowerShell can be used to extract LAPS Passwords and BitLocker Keys from Active Directory. This was written on Friday, July 19, 2024, due to the CrowdStrike Outage. If you choose to test this PowerShell, ensure that you update the argument for the SearchBase parameter to reflect your Active Directory domain.
  • The Maddening Side of the Microsoft Graph PowerShell SDK \ All software has unique quirks, and the foibles of the Microsoft Graph PowerShell SDK are well known. But it’s much harder when the underlying foundation contributes to the craziness as described in this article. Graph pagination works in a specific way and Microsoft tunes the Graph to deliver great performance by reducing the set of properties returned for objects. Both can cause concern for developers.
  • Find orphaned GPOs via PowerShell before migrating to Intune \ Many companies have already fully transitioned to Endpoint Management Intune and no longer need GPOs (Group Policy Objects). Others are in the preparatory stages. Therefore, I would like to provide some assistance for identifying orphaned Group Policy Objects. These can be relatively easily found and, if necessary, removed using PowerShell.
  • Convert RSA XML Private Key to PEM Format with PowerShell \ Recently I was working with a particular application that used certificates to secure communication. I wanted to put the certificates into Azure KeyVault. Azure KeyVault naturally allows you to store certificates. However, it only lets you upload certificates that are in PFX (PKCS#12) or CER (DER or BASE64 encoded).… keep reading
  • PowerShell script for automated remediation for CrowdStrike issue \ I have created a Powershell script for the Crowdstrike issue for some automation purposes. you can create a WinPE ISO File to boot into and remediate the crowdstrike issue. 3. Reboot: The system should boot normally. The script: This script is designed for use in an on-premises VMware environment.

Projects, Scripts, and Modules

  • pwshBedrock v 0.9.1 \ pwshBedrock enables interfacing with Amazon Bedrock foundational models, supporting direct on-demand model calls via InvokeModel and the Converse API for supported models. It allows sending messages, retrieving responses, managing message context, displaying model information, and estimating token counts and costs. Use PowerShell to integrate generative AI applications with Amazon Bedrock.
  • ChocoLogParse v 1.0.0 \ Parses Chocolatey logs into easy to use objects.

Books, Media, and Learning Resources

  • Diagnose Network Latency with PowerShell and SQLite [OC] \ In this video you’ll see how you can use PowerShell to check for network latency between multiple endpoints. You’ll learn how to record those results into a SQLite database with a just few commands, and no need to create any underlying infrastructure. Finally, you’ll see how you can view the data in PowerShell to help identify where and when you are experiencing network latency issues.

Community

  • Interactive Shell Sessions and Language Models: Steven Bucher on Project Mercury \ In the latest episode of the PowerShell Podcast, we sit down with Microsoft PM Steven Bucher to dive into Project Mercury, a cutting-edge CLI tool designed to provide an interactive shell session for chatting with language models. Steven walks us through the functionalities of Project Mercury and how users can leverage this innovative tool. He also shares his approach to product management, reflecting on his growth in the role over the past couple of years. We explore the importance of empowering others and how it serves as a pivotal goal in Steven’s professional journey. Join us for an enlightening conversation that blends technical knowledge with leadership wisdom.
  • PowerShell Community Call - July 18th, 2024 \ The record of the July 18, 2024 PowerShell Community Call

Check out psweekly.dowst.dev for all past editions as well as a searchable archive.

0

PowerShell Weekly for June 21, 2024

Announcements!

Blogs, Articles, and Posts

  • Using PowerShell to Post Channel Messages with Teams Workflows \ The incoming webhook connector is a popular method to post information to Teams channels, but Microsoft seems set on retiring the Office connectors. The Teams post to channel workflow when a webhook request is received seems like is a possible replacement, but it's not just a matter of switching mechanisms. Some PowerShell magic is needed to create a suitable adaptive card to post to the channel, which is exactly what we explain how to do here.
  • Working with Calendar Permissions using the Microsoft Graph PowerShell SDK \ The Set-MailboxFolderPermission cmdlet is usually used to set calendar permissions, including the permission for the default user to allow everyone in an organization to see each other’s calendars. But you can use cmdlets from the Microsoft Graph PowerShell SDK too. The Graph SDK cmdlets are faster, but not enough to warrant replacing the Exchange cmdlet in scripts. We explain why here.
  • Automate Azure DevOps Work Item Updates with Azure Functions and the Azure DevOps API \ I use Azure DevOps Boards for agile project management, allowing me to plan, track, and discuss automation and DevOps tasks. I also create reporting dashboards from the data within the work items. One such metric I report on is how much time we save when implementing a new automation.
  • How to check if an Azure Marketplace image is marked for deprecation \ How to check if an Azure Marketplace image is marked for deprecation.
  • How to Add or Remove Pinned Folders to Quick Access with PowerShell and GPO \ Windows File Explorer has a separate panel that displays a list of favorite folders and locations called Quick Access. Many users and administrators unjustly ignore this handy Windows tool
  • How to Split a String by Length in PowerShell? \ When you need to split a string by a specific length, PowerShell offers various methods to do it. This PowerShell tutorial explains various methods to split a string by length in PowerShell To split a string by length in PowerShell, you can use a loop with the Substring method to iteratively extract parts of the string
  • Using Measure-Command and Measure-Object in PowerShell \ Measuring is always a good idea for grasping things, such as how long it sometimes takes, how many objects there are in a specific directory, how much space something takes up on a hard drive, etc. In this blog post, I will show you how the Measure-Command and Measure-Object cmdlets work and how you can use them to your advantage.
  • How to disable per-user MFA using Microsoft Graph PowerShell \ Learn how to use Microsoft Graph PowerShell to disable per-user MFA in Microsoft Entra to support migration to Conditional Access.

Projects, Scripts, and Modules

  • Version 1.9 of the Microsoft 365 Licensing Report \ The Microsoft 365 Licensing Report is a popular PowerShell script that's just been updated to V1.9 with a bunch of changes to highlight different aspects such as license costs for disabled user accounts and inactive user accounts. Copious use of some very dubious color choices makes the HTML report created by the script look very nice (if you're color blind) and the new version can generate an Excel worksheet.
  • PowerShellRun v0.7.0 \ In PowerShellRun v0.7.0, you can now add script blocks and script files as entries. If you are managing many PowerShell scripts, PowerShellRun will help you create a TUI script launcher.

Books, Media, and Learning Resources

  • Monitor Your Network with PowerShell [OC] \ In this video you’ll see the full process I went through to create a script to monitor up and down times for my network.
  • Managed Identity With PowerShell And Azure Automation Accounts \ Join me in creating an automation account and using managed identity to connect to Azure, ExchangeOnline and Graph in this practical powershell example where we'll discuss how to connect, how to add permissions to a service principal and also a little bonus tip on how to get an access token for graph using Az and managed identity with the Get-AzAccessToken cmdlet.

Community

  • Andrew Celebrates & Previews psconf.eu with Christian & Bjorn \ In this episode of the PowerShell Podcast, Andrew starts things off by celebrating his new Microsoft MVP. Then, we hear about all things psconf.eu and what to expect from Christian Ritter and Björn Sundling at PSConf EU. We hear some of the juicy details and key takeaways from their sessions. Then we get an update on some of their projects like PSClippy, AzDM, PSSecretScanner, and much more!

Check out psweekly.dowst.dev for all past editions as well as a searchable archive.

0

Monitor Your Network with PowerShell

I recently created a YouTube channel where I do deep dives into creating automations with PowerShell. Instead of just publishing the solutions I take you through the entire development process.

In this video I go through creating an uptime monitor for multiple IP addresses that can ping each IP every minute. I go through the evolution of trying Test-NetConnection, then giving up and using dotnet objects for asynchronous execution. And finally, how to put that all together and get your results.

This is only my fourth video, so any and all feedback on it is welcome.

5

PowerShell Weekly for May 31, 2024

Announcements!

Blogs, Articles, and Posts

  • PowerShell Tool-Building 101: Building a Computer Inventory Report \ Join me on an exciting journey as we build a powerful PowerShell tool for generating computer inventory reports! From CSV files to CIM queries and error handling, we'll walk you through each step as we go. Let's script our way to success!
  • Deploy Windows 11 with the free PowerShell framework OSDCloud \ OSDCloud is a free PowerShell framework for deploying Windows 10 and Windows 11. The tool provides simple methods for adding drivers and configuring settings in an image. After booting from a customized WinPE, either the OSDCloudGUI or an automated script initiates the installation.
  • Practical PowerShell Series: Part 4 Branching \ In my previous article in the Practical PowerShell series, I discussed looping as part of flow control. In this article, I cover another essential part of flow control: branching. Branching defines multiple paths for your code to follow, depending on conditions.
  • Querying DNS Records with PowerShell \ In this blog post explore how you can use PowerShell to query DNS records.
  • A simple PowerShell script template I use when creating new scripts \ I spin up new PowerShell scripts all the time, whether just for quickly experimenting and testing things out, or for projects that I know will be around for a while. There’s a few basic things that I like all my scripts to have, so I’ve created a simple template that I use when creating new scripts.
  • Working with Teams Messaging Using the Microsoft Graph PowerShell SDK \ This article describes how to use the Microsoft Graph PowerShell SDK to interact with Teams messaging to create new one-to-one and group chats and post messages to chats and channel conversations.

Projects, Scripts, and Modules

Books, Media, and Learning Resources

  • PowerShell Scripting and Toolmaking \ Several years ago Don Jones and I wrote what we hoped would be the definitive book on PowerShell scripting and toolmaking. The book takes all off our years of experience, not only from writing PowerShell code, to teaching and conference presentations where we hear first hand what people struggle with.
  • Frontend PowerShell with Google Forms: Part 2 Replying with Gmail \ [OC] Learn how to integrate Gmail into your scripts to send automated email responses. You’ll also learn how to make your automations more flexible by accounting for things like hitting grid limits in Google Sheets.

Community

  • Inside IT Automation | E04 | Erwin van Hunen talks about PnP PowerShell, MS Graph, music and more \ Erwin is the 'Father' of PnP PowerShell, an open source PowerShell module that is used millions of times everyday worldwide to perform automated tasks towards Office 365 and SharePoint. He is also a Microsoft MVP and well-known public speaker, and technology evangelist. As Chief Technolgy Officer he shapped products and services at Valo, Staffbase and Rencore. Currently he is Head of Product at MondayCoffee.
  • PowerShell on Linux and Beyond with Steven Judd \ In this celebration-themed episode of the PowerShell Podcast, Steven Judd makes his long-awaited return. We announce the first PowerShell Podcast MVP winner. We share tips about regex and URL encoding and dive deep into PowerShell on Linux, CloudShell, and becoming a lifelong learner. All this and more!

Events

Check out psweekly.dowst.dev for all past editions as well as a searchable archive.

0

PowerShell Weekly for May 24, 2024

Blogs, Articles, and Posts

  • Upload a PowerShell Script to Intune (With PowerShell) From Scratch \ Automate deploying PowerShell scripts to Intune devices with Azure app registration, Graph API, and more in this step-by-step tutorial.
  • Remove store apps from a Windows image \ In professional environments, most store apps delivered with Windows are of little value, prompting admins to remove them from the image before deployment. However, you should avoid indiscriminately deleting them, as some system-relevant apps may be among them. PowerShell can be used to remove the crapware selectively.
  • Find the Teams Meetings Attended by a Specific User Using PowerShell \ Ever wondered how much time your team members spend in Teams meetings? Or perhaps you’re tasked with analyzing an individual’s meeting activity within Teams. Look no further! In this blog, we’ll explore the methods to obtain user-specific Teams meeting reports. Here, we’ll also introduce a crafted PowerShell script that simplifies the process…
  • Parameters for PowerShell Scripts and Functions \ Using parameters for your Scripts and Functions is very powerful. You don't have to hardcode things in them, making running them from a command line easier. This blog post will show you the parameters I use in most of my scripts and how they work.
  • Use the Azure OpenAI GPT-4o (all-in-one-model) with PowerShell! \ On May 13th GPT-4o was released in preview in the Azure OpenAI Playground. No API access, only accessible in the browser. Today I was going into the playground to test something with the GPT-4o model, but could not find it. What had happened? Turnes out it suddenly was in GA and available to choose under … Continue reading Use the Azure OpenAI GPT-4o (all-in-one-model) with PowerShell!
  • Automating PowerShell tasks with Container App Jobs \ I previously wrote about Automating maintenance tasks with Azure Functions and PowerShell. That combo has been my go-to solution for many automation tasks.
  • A Powershell GUI using DotNet Windows.Forms to start AWS Lambda Functions and display their output \ A Powershell GUI using DotNet Windows.Forms to start AWS Lambda Functions and display their output - powershell-gui-aws-lambda-start-functions.ps1

Projects, Scripts, and Modules

  • WinGet.CommandNotFound \ We are pleased to announce the release of WinGet.CommandNotFound! This PowerShell module is a feedback provider plugin for PowerShell that leverages the Windows Package Manager to provide suggestions for packages to install when a native command cannot be found. The command-line predictor feature in PowerShell enables this module to display WinGet packages as predictive suggestions.
  • Keep Microsoft Teams status Available instead of away using PowerShell \ It is one of the things I hear my colleagues, and even my girlfriend, mention regularly... Why does Microsoft Teams think I'm away while I'm not / My PC isn't locked yet... I read a few solutions, setting your status duration to a date in the future, etc... Didn't work :( What does work is running my simple PowerShell scripts, which I will show you in this blog post :)
  • ps-arch-wsl v 0.1.1 \ Install Arch Linux on Windows the easy way.
  • Posh-ACME v 4.23.1 \ ACME protocol client for obtaining certificates using Let's Encrypt (or other ACME compliant CA)
  • dbatools.ai v 1.0 \ dbatools.ai is a copilot for SQL Server databases

Books, Media, and Learning Resources

Community

  • PowerShell on the road at MMS-MOA with Sven De Groote and Chris Thomas \ On this episode of the PowerShell Podcast, Andrew is back on the road, attending the MMS 2024 at MOA conference. Andrew catches up with Sven De Groote and Chris Thomas. Andrew and Sven take a dive into the PSAppDeployToolkit. Later in the episode, Andrew and Chris chat about PSADT, Chris’ PowerShell journey, his talk at MMS-MOA, and more.

Check out psweekly.dowst.dev for all past editions as well as a searchable archive.

0

PowerShell Weekly for March 1, 2024

Blogs, Articles, and Posts

  • Creating a scalable, customised running environment \ This post shows how to create an easy to support environment with all your own cmdlets.
  • Module Linking \ I know it has been a while since I’ve given the blog any attention. I am hoping to correct that in 2024, although I’m already behind schedule. But let’s get to it. I have a short tip today that you may find useful, especially if you write modules for your private use.
  • Cloning Hyper-V VMs with PowerShell \ Unlike when using Windows Admin Center to manage your Hyper-V VMs, Hyper-V Manager, nor the built-in cmdlets, offer any native VM cloning function. But with a bit of creative scripting, it's certainly doable. Here is a script that clones a virtual machine in Hyper-V: Unlike when using Windows Admin Center to manage your Hyper-V VMs, Hyper-V Manager
  • PowerShell Script Parameters: Getting Started Guide \ PowerShell script parameters are vital components that enable the customization and versatility of scripts, functions, and cmdlets. PowerShell parameters enhance the usability and adaptability of scripts by allowing users to pass information into the code instead of hardcoding values. Understanding how to define, manipulate, and leverage PowerShell parameters is essential for proficient scripting in PowerShell.

Projects, Scripts, and Modules

  • Report OneDrive for Business Storage Based on Usage Data \ If you wanted to write a PowerShell script to create a OneDrive storage report, you'd probably use the cmdlets from the SharePoint Online management module. But accessing OneDrive usage data via the Graph is much faster. And you can include information from other sources, such as user properties, to build out the report. All explained here.
  • Report and Audit File Downloads in SharePoint Online Using PowerShell \ SharePoint Online is a powerful collaboration service in Microsoft 365 that facilitates seamless file sharing and management across organizations. While it provides extensive capabilities, tracking file downloads is crucial for maintaining data security and compliance. This blog highlights the methods to audit file downloads in SharePoint Online.   How to…
  • PowerShellRun \ App, Utility and Function Launcher for PowerShell. PowerShellRun is a PowerShell module that lets you fuzzy search applications, utilities and functions you define and launch them with ease. It is a customizable launcher app on the PowerShell terminal.
  • Find All agent-based Hybrid Runbook Workers [OC] \ In case you are not away the Microsoft Monitoring Agent (MMA) will be retired on 31 August 2024. Prior to this date you will need to migrate all your agent-based hybrid workers to the extension-bas…
  • PSSharedGoods v 0.0.278 \ Module covering functions that are shared within multiple projects

Books, Media, and Learning Resources

Community

  • From Admin to Defender: Jake Hildreth's Security Evolution \ In this episode of the PowerShell Podcast, Andrew sits down with the knowledgeable Jake Hildreth for an enlightening conversation covering a wide array of security-related topics. Jake shares insights from his journey transitioning into security from a background in operations and administration. The discussion delves into OpSec practices, approaches to toolmaking, and the critical importance of Active Directory Certificate Services (AD CS) security. Jake also sheds light on tabletop exercises for security, the fallacy of security through obscurity, and the dangers of clicking on phishing emails. Tune in for a deep dive into the world of security and PowerShell with Jake Hildreth!

Fun

  • PowerShell Emoji \ PowerShell Emoji is a little PowerShell module to help you work with Emoji.

Check out psweekly.dowst.dev for all past editions as well as a searchable archive.

0

2023: A PowerShell Year in Review

www.dowst.dev 2023: A PowerShell Year in Review

2023 was quite the year for me and PowerShell, so I thought I would put together a brief summary of the year as I saw it. Plus provide you with some fun and interesting statics from the PowerShell …

2023: A PowerShell Year in Review

Check out my review of the past 12 months of PowerShell and the PowerShell Weekly newsletter.

I'd also love to hear what others have to say about the past year as well.

0

Display Profile Functions

www.dowst.dev Display Profile Functions

If you are like me and have multiple machines you work on with different profiles, it can be difficult to remember which profile contains which functions. So, I wrote a quick function that will dis…

Display Profile Functions

If you are like me and have multiple machines you work on with different profiles, it can be difficult to remember which profile contains which functions. So, I wrote a quick function that will display all the functions for me on start up.

0

PowerShell Weekly for June 30, 2023

0

PowerShell Weekly for June 23, 2023

0

PowerShell Weekly for June 16, 2023

PowerShell Weekly is a hand curated list of PowerShell news, blogs, scripts, etc. that I discover each week and feel are worth passing on. In other words it is not just me reporting everything with a PowerShell hashtag.

There is nothing to sign-up for and there are no ads. It's just my little way of giving back to the community. I also do not accept any sponsored content, but I do take recommendations and suggestions from the community, so feel free to send things my way.

I try to get it published by 9 am US central time (2 pm UTC) each and every Friday. (Expect for the week between Christmas and New Years, I give myself that week off)

It has been going strong for 4 years now and the entire back catalog is searchable and tagged with categories, authors, and timeframes.

0

c/PowerShell Community Feedback

I want to make this a place that everyone can get the most out of. So, I've been working on a list of guidelines/rules for this community. Instead of just posting them in the sidebar, I thought I would post my proposed rules here first to provide everyone a change to provide feedback.

So, please let me know if you have any thoughts or suggestions.

---

Rules:

  • Be civil (aka don’t be a jerk). Remember there are people from all walks of life, all with different levels of expertise. You can disagree with someone, but please be civil when doing so.
  • Adhere to the Lemmy Code of Conduct
  • Follow all programming.dev rules
  • Posts must relate to PowerShell or the PowerShell ecosystem.
  • Use code blocks to make things easier to read.
  • Memes and humorous posts are allowed but try not over do it. And keep them relevant to PowerShell
  • No discussion about piracy or hacking.
  • If someone provides an answer that solves your problem, please reply, so others know what the solution was. And so the person who suggested it gets that oh so sweet shot of dopamine.
  • If you find a solution to your problem by other means, please take your time to write down the steps you used to solve your problem in the original post. You can potentially help others having the same problem!

Self-promotion rules:

  • Self-promotion content must be marked as [OC]
  • Do not SPAM. Content must be PowerShell related.
  • Only 10% of your contributions can be self-promotion. In other words, 90% of your contribution must not be self-promotion.
  • Personal blogs are not considered self-promotion, at this time, as long as they are free to access and relevant. Please do not abuse this.

---

Also, let me know if you are interested in helping moderate this community.

1