PowerShell for Windows Admins:

Powershell


August 23, 2019  1:12 PM

Experimental features

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell core has recently. v6.2, had the concept of experimental features added. An experimental feature is new or changed functionality that may be a breaking change or about which the PowerShell team want feedback before finalising the code. My PowerShell v6.2.2 instance has the following...

August 21, 2019  12:30 AM

PowerShell v7 preview 3

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell v7 preview 3 is now available from https://github.com/PowerShell/PowerShell/releases Breaking changes seem to be confined to non-Windows platforms with the removal...


August 15, 2019  1:22 PM

Out-GridView is back

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Out-GridView is finally back in PowerShell core - https://devblogs.microsoft.com/powershell/out-gridview-returns/. The project is hosted on github...


August 9, 2019  4:24 AM

Test if a transcript is running

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell has the ability to create a transcript of the commands you run at the console and the results displayed in the console. But how can you test if a transcript is running? It used to be that you could only have a single transcript running but Windows PowerShell v5.1 and PowerShell v6.x...


August 5, 2019  10:38 AM

Identifying the host

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Identifying the host in which your PowerShell code is running could be important. For instance you might not want to run some code that takes a long time to complete in VSCode – you may prefer to ensure it runs in the console as it consumes fewer resources. You can identify the host – most...


August 3, 2019  9:20 AM

PowerShell Day UK 2019

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The PowerShell Day UK 2019 one day conference is on Saturday 28 September 2019 - https://psday.uk/ I’ll be speaking and willing to answer any PowerShell questions that I can during the breaks. If you have any books of mine that you...


July 31, 2019  8:35 AM

Unblock and unzip

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

When you download a zip file from the Internet you have to unblock and unzip the file. I need to do this fairly often so wrote this simple function to perform both actions rather than doing it manually. function unzipfile { param ( [string]$path ) Unblock-File -Path $path Expand-Archive...


July 31, 2019  4:50 AM

Variables in scriptblocks

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

I often see questions regarding the use of variables in scriptblocks. Usually a variable will be defined outside the scriptblock and then an attempt will be made to use it in the scriptblock: PS> $path = 'C:\test\OldData01.txt' PS> Start-Job -Name j1 -ScriptBlock {Get-FileHash -Path $path...


July 29, 2019  12:59 PM

Test local user doesn’t exist before creating

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Saw a question asking how to Test local user doesn’t exist before creating. Windows 8 introduced the LocalAccounts module for Windows PowerShell. On Windows 10 1903 it runs in PowerShell v6/7. There isn’t a Test-Localuser cmdlet but you can attempt to get the user before...


July 28, 2019  5:31 AM

Missing verbs?

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

I saw a post that suggested that you can’t use Sort as a verb in your functions. You get a message that sort is an unapproved verb. Are there any other missing verbs? I started with the object cmdlets as they are probably the most used cmdlets. Running Get-Command *-Object...


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: