PowerShell SnippetRace 46/47-2022

PSInfo, -contains, $PSBoundParameters, duplicates

Events

  • Summary – PowerShell Workshop (MS-Graph, PowerShellGet, PSReadline). Get the examples, a written summary and a link to the video here. LINK
  • PowerShell Usergroup Meeting Q1/2023 (Agenda TBD)
  • Expertslive Konferenz June 21, 2023 Linz.

Snippets

PSInfo

PSInfo is part of the legendary sysinternals suite. Leo Marek posted an article on PSInfo and how to effectively use it with remote systems and handle the output of mass-queries.

My PSInfo Screenshot

The -contains Operator

I guess there is a big crowd of people which just guessed how the contains operator should work and failed terribly. Read Nicholas Xuan Nguyens post on the -contains operator based on PowerShell 7.2.6.

-contains simple examples, read article for more

$PSBoundParameters

There are a lot of features under the hood of PowerShell which are not uncovered by a lot of people. Read Jeffrey Hicks article on $PSBoundParameters and how to make your wrapper-functions much better readable. Microsoft documentation on PSBoundParameters is here.

Find and remove duplicate files with PowerShell

Working with a lot of files may get you to the point where you need to find and remove duplicates. Read Surender Kumars article on this task.

I hope you found some interesting details in this blog. Have a nice week.

R.

Picture from Jan Van Bizar