header image

Archive for August, 2019

Pet peeves

Posted by: | August 31, 2019 Comments Off on Pet peeves |

Back in July I mentioned the using ? instead of Where-Object was a pet peeve. I’ve been asked a few times since for other pet peeves. The order of peevishness changes over time but these three will probably be always near the top.   In no particular order.   Peeve – the use of aliases […]

under: Uncategorized

Foreach-Object -parallel

Posted by: | August 30, 2019 Comments Off on Foreach-Object -parallel |

The introduction of Foreach-Object -parallel in PowerShell v7 preview 3 brings some much needed parallelisation options back into PowerShell.   PowerShell workflows are available in Windows PowerShell but are quirky (to be kind) and can be difficult to use. Workflows were removed in PowerShell v6.0   In PowerShell v7 preview 3 Foreach-Object receives a –parallel […]

under: PowerShell 7

Testing Windows activation

Posted by: | August 29, 2019 Comments Off on Testing Windows activation |

Testing Windows activation from PowerShell involves a little dive into CIM (WMI). At its simplest a function like this function test-activation { $ta = Get-CimInstance -ClassName SoftwareLicensingProduct -Filter “PartialProductKey IS NOT NULL” | Where-Object -Property Name -Like “Windows*” if ($ta.LicenseStatus -eq 1) {$true} else {$false} }   Checks the SoftwareLicensingProduct class for instances with a […]

under: PowerShell and CIM

Get-AdUser in PowerShell Core

Posted by: | August 29, 2019 Comments Off on Get-AdUser in PowerShell Core |

There has been a problem with Get-ADUser in PowerShell core such that Get-ADUser -Identity Richard -Properties *   Throws an error.   The problem is in .NET Core and affects a small number of properties including ProtectedFromAccidentalDeletion   The underlying .NET Core issue has been fixed and PowerShell v7 preview 3 on Windows 10.0.18362 will […]

under: PowerShell 7, PowerShell and Active Directory, PowerShell v6

Windows Terminal v0.4.2382.0

Posted by: | August 28, 2019 Comments Off on Windows Terminal v0.4.2382.0 |

Windows Terminal v0.4.2382.0 has ben released to the Microsoft store. if you have Windows Terminal installed it should automatically update for you.   Copying out of a window using the keyboard shortcuts now works – thank you – that makes the whole thing much more usable.   I can’t seem to find a way to […]

under: PowerShell

Experimental features

Posted by: | August 23, 2019 Comments Off on Experimental features |

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 experimental features PSImplicitRemotingBatching PSUseAbbreviationExpansion PSCommandNotFoundSuggestion PSTempDrive   of which I’ve […]

under: PowerShell 7, PowerShell v6

PowerShell v7 preview 3

Posted by: | August 21, 2019 Comments Off on PowerShell v7 preview 3 |

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 of the kill alias on Stop-Process and support for pwsh as a login shell   The big new item is the –parallel parameter on Foreach-Object – more on this later.   In this preview version […]

under: PowerShell 7

Out-GridView is back

Posted by: | August 15, 2019 Comments Off on Out-GridView is back |

Out-GridView is finally back in PowerShell core – https://devblogs.microsoft.com/powershell/out-gridview-returns/.   The project is hosted on github – https://github.com/powershell/GraphicalTools   Install the module from the gallery – PS> Install-Module -Name Microsoft.PowerShell.GraphicalTools   Currently, Out-GridView is the only command in the module though adding Show-Command and Show-Object are planned.   The module works cross-platform not just Windows. […]

under: PowerShell 7, PowerShell v6

PowerShell v2

Posted by: | August 13, 2019 Comments Off on PowerShell v2 |

Just seen a question about PowerShell v2. PowerShell v2 was a huge step forward when it appeared in October 2009 as part of Windows 7 / Server 2008 R2   Windows 7 support finishes 14 January 2020 Windows Server 2008 R2 support finishes 14 January 2020   That’s less than 6 months.   PowerShell v2 […]

under: PowerShell v2

Test if a transcript is running

Posted by: | August 9, 2019 Comments Off on Test if a transcript is running |

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 and later […]

under: PowerShell

Older Posts »