PowerShell
774 subscribers
214 photos
4 videos
1 file
802 links
Task automation and configuration management framework #PowerShell
Download Telegram
Fossilize – Mastodon account backup tool
By: Chrissy LeMaire

This GitHub Action will help you backup Mastodon account items to CSV files
Link
Today's cmdlet ‣ New-WinEvent
Creates a new Windows event for the specified event provider.

Example's Remarks:
• This command uses the `New-WinEvent` cmdlet to create event 45090 for the Microsoft-Windows-PowerShell provider.

#tutorial
Today's tip ‣ Arrays: Common

”A 1-dimensional array has type `type[]`, a 2-dimensional array has type `type[,]`, a 3-dimensional array has type `type[,,]`, and so on, where type is object for an unconstrained type array, or the constrained type for a constrained array.”
$a = [int[]](1,2,3,4) # constrained to int
#tip
Loving the Community with Phil Bossman
By: The Powershell Podcast

In this episode, Phil shares his favorite thing about PowerShell: the community. As a leader of the RTPSUG, Phil encourages Andrew and Jordan to submit for Summit while not committing himself fully. Phil loves the PowerShell community and troubleshooting. He doesn't define Yak Shaving but says other stuff worth listening to.
Link
Today's cmdlet ‣ Restart-Service
Stops and then starts one or more services.

Example's Remarks:
• This command starts all of the stopped network services on the computer.

#tutorial
PowerShell 7 Tutorials for Intermediates #8 : Working with XML
By: JackedProgrammer

In this video I will go over how to work with XML in PowerShell 7. I will show how to import a .xml that was written by someone or another application and then also take a look at PowerShell's ability to generate CliXml files and import-clixml / export-clixml
Link
Change $PSNativeCommandArgumentPassing to default to Legacy on stable release and Windows on previews
By: Steve Lee

Given the impact to users with the 7.3.0 release, proposal is to change the default of $PSNativeCommandArgumentPassing to Legacy on Windows (still Standard on non-Windows). We would keep the default as Windows on Windows for preview releases. This would be backported to 7.3.x
Link
Custom PowerShell Script for Release Retention in Azure DevOps
By: Eric Eissler

If you're using Azure Devops Classic, you can retain production releases forever using an extension it has. That said, what if you want to retain releases from another environment or you want to set your own retention policy? Learn more in this article.
Link
Today's cmdlet ‣ Get-WinEvent
Gets events from event logs and event tracing log files on local and remote computers.

Example's Remarks:
• The `Get-WinEvent` cmdlet uses the LogName parameter to specify the Windows PowerShell event log.
• The event objects are stored in the `$Event` variable.
• The Count property of `$Event`shows the total number of logged events.

#tutorial
Send MDM commands without an MDM service using PowerShell
By: Michael Niehaus

Sometimes you run into something completely by accident; other times, it's more of a building process based on work that you've done in the past.
Link
Image Manipulation, Image Resize, Image Combine and more with PowerShell
By: Przemyslaw Klys

ImagePlayground is a PowerShell module that works in PowerShell 5.1 and PowerShell 7+. It works partially on Linux and should work on macOS, except for charts. That means it's partially cross-platform, but the end goal is to make it work fully on all platforms. So what can this module do?
Link
Breaking PowerShell
By: Steve Landry

An awesome new site, that already has a ton of great content.
Link
Mastering PowerShell Dynamic Arrays
By: Jeff Brown

PowerShell arrays are a powerful construct when working with a group of similar items. You can loop through them and access items using their index values. However, adding or removing items to a fixed array is not intuitive and, depending on the method, can cause performance issues. This article will teach you different strategies
Link
Today's cmdlet ‣ Format-Custom
Uses a customized view to format the output.

Example's Remarks:
• This command formats information about the `Start-Transcript` cmdlet in the format defined by the MyView view, a custom view created by the user.
• To run this command successfully, you must first create a new PS1XML file, define the MyView view, and then use the `Update-FormatData` command to add the PS1XML file to PowerShell.

#tutorial
Use PowerShell splatting and PSBoundParameters to pass parameters
By: Jeffery Hicks

The automatic variable PSBoundParameters stores the parameters that you explicitly passed to a function in a hash table. With the help of splatting, you can use this PowerShell feature to simplify passing of parameters to functions.
Link
👍1
Today's tip ‣ Hashtables: Hashtable creation

”A `Hashtable` is created via a hash literal @{} or the New-Object cmdlet. It can be created with zero or more elements. The Count property returns the current element count.”

#tip