PowerShell for Windows Admins:

June, 2019


June 30, 2019  2:52 PM

PowerShell Space Invaders

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Way back in 2007 (PowerShell v1 days) I wrote about PowerShell space Invaders.  I’ve just tried it in PowerShell v7 preview 1 and it seemed to work just fine including sound. It runs in PowerShell v6.2.1 but without sound – there some error messages that probably relate to the missing...

June 30, 2019  10:28 AM

Load format file in a module

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Staying with the test-connection function I thought I’d show how to turn the function and format file into a module. This includes how to load the format file in a module. Create a folder TestConnection Copy the format file and the script file that contains the test-connection function into...


June 30, 2019  4:51 AM

Test-Connection formatting

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Last time I showed how to write a function that replaces the current PowerShell 6/7 Test-Connection. This time I’ll show you how to do the Test-Connection formatting. Using just the function you get something like this: PS> test-connection -computername 127.0.0.1 Success :...


June 27, 2019  10:37 AM

PowerShell 6/7 Test-Connection

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The PowerShell 6/7 Test-Connection implementation as of PowerShell v6.2.1 and PowerShell v7.0 preview 1 is in my opinion a horrible example of how not to create output. the cmdlet shows each ping and then wraps all of the results in the Replies property so you need to do something like...


June 26, 2019  10:38 AM

Quotes in CSVs

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Up to and including PowerShell v6.2.x converting or exporting data to a csv has automatically put quotes round each field. In PowerShell v7 you can control quotes in CSVs Using Get-Service | ConvertTo-Csv as an example. The current behaviour is to put quotes round...


June 25, 2019  4:27 AM

CDXML schema checks

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell v3 introduced CDXML modules. Cmdlet Definition XML wraps a CIM class in XML to create a module. The methods of the CIM class can be used to generate additional cmdlets for the module. Many of the modules introduced with Windows 8 – including the networking and storage modules – are...


June 24, 2019  11:04 AM

PowerShell Line continuation

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

There are a number of ways to signal PowerShell line continuation in your code. probably the most common is to have a pipeline symbol at the end of the line: Get-Process | Sort-Object -Property CPU -Descending -Top 5 because there’s nothing after the pipe symbol PowerShell assumes that the...


June 22, 2019  5:29 AM

Test DNS servers

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

Had a recent comment about testing DNS servers which got me thinking how do I test DNS servers. I decided I wanted to get the DNS server address from the client, ping the DNS server to test network connectivity and test if DNS was up and working. The current result is this: function...


June 22, 2019  3:59 AM

Windows Terminal

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Windows 10

Microsoft have released the first preview of the new Windows Terminal to the Windows store - 0 Comments     RSS Feed     Email a friend


June 21, 2019  5:32 AM

PowerShell 7 roadmap

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

It was recently announced that the next version of PowerShell core will be 7.0 not 6.3. The PowerShell 7 roadmap is available at 0 Comments     RSS Feed     Email a friend


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: