header image

Archive for October, 2019

Resolve-Path

Posted by: | October 31, 2019 Comments Off on Resolve-Path |

Resolve-Path is a cmdlet I haven’t used much – if at all – so I thought I should have a look at it. At an arbitrary point in the file system: PS> Get-Location Path —- C:\Scripts\Modules\Coordinates   .. Indicates the next level up PS> Get-ChildItem -Path .. Directory: C:\Scripts\Modules etc   ..\.. indicates two levels […]

under: PowerShell

Ad hoc development

Posted by: | October 31, 2019 Comments Off on Ad hoc development |

I was having a discussion about how people can learn PowerShell at the recent UK PowerShell day and mentioned ad hoc development. Surprisingly, no-one really knew what I meant.   Ad hoc development is a concept more than a development type. It was used extensively back in the days of PowerShell v1 and v2 but […]

under: PowerShell

Pipeline Chain operators

Posted by: | October 30, 2019 Comments Off on Pipeline Chain operators |

Another experimental feature from PowerShell v7 preview 5 brings pipeline chain operators to PowerShell. PS> Get-ExperimentalFeature -Name PSPipelineChainOperators | Format-List Name, Description Name : PSPipelineChainOperators Description : Allow use of && and || as operators between pipeline invocations   The operators work as follows <command1> && <command2> means that command2 will fire if command1 completes […]

under: PowerShell 7

Get-Error

Posted by: | October 30, 2019 Comments Off on Get-Error |

One of the experimental features new PowerShell v7 preview 5 is the Get-Error cmdlet. The features description states: Enable Get-Error cmdlet that displays detailed information about ErrorRecords included nested objects   Enable the feature: PS> Enable-ExperimentalFeature -Name Microsoft.PowerShell.Utility.PSGetError WARNING: Enabling and disabling experimental features do not take effect until next start of PowerShell.   It […]

under: PowerShell 7

Returning cmdlets

Posted by: | October 29, 2019 Comments Off on Returning cmdlets |

If I’m interpreting the email updates coming from the PowerShell project the next code release of PowerShell v7 should see the following returning cmdlets: Get-Counter Update-List Clear-RecycleBin Out-Printer All but Update-List are Windows only as far as I can ell

under: PowerShell 7

Error view

Posted by: | October 29, 2019 Comments Off on Error view |

Error view is another experimental feature introduced with PowerShell v7 preveiw 5. The experimental feature needs to be enabled and PowerShell restarted. PS> Enable-ExperimentalFeature -Name PSErrorView WARNING: Enabling and disabling experimental features do not take effect until next start of PowerShell.   At the PowerShell prompt you’d normally see an error in this form PS> […]

under: PowerShell 7

Test-Connection

Posted by: | October 28, 2019 Comments Off on Test-Connection |

In PowerShell v7 preview Test-Connection sees some improvements: PS> Test-Connection -TargetName 127.0.0.1 | Format-List Source : W510W10 Destination : 127.0.0.1 Replies : {System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingReply}   The progress bar has been removed as has the unrequired text displayed with each ping. The replies are still wrapped up in a collection of objects each of […]

under: PowerShell 7

Null coalescing with Object properties

Posted by: | October 28, 2019 Comments Off on Null coalescing with Object properties |

The Null coalescing operators were introduced in PowerShell v7 preview 5. last time you saw how to use Null coalescing with variables. You can also use Null coalescing with Object properties. Let’s first create an object. PS> $prop = @{Nullprop = $null; NonNullProp = ‘something’} PS> $obj = New-Object -TypeName PSobject -Property $prop   Yes, […]

under: PowerShell 7

Null coalescing operators

Posted by: | October 25, 2019 Comments Off on Null coalescing operators |

Powershell v7 preview 5 introduces a new experimental feature that supports Null coalescing operators and null coalescing assignment operstors. As its an experimental feature: PS> Get-ExperimentalFeature -Name PSCoalescingOperators | Format-List Name : PSCoalescingOperators Enabled : False Source : PSEngine Description : Support the null coalescing operator and null coalescing assignment operator in PowerShell language   […]

under: PowerShell 7

PowerShell v7 preview 5 experimental features

Posted by: | October 24, 2019 Comments Off on PowerShell v7 preview 5 experimental features |

PowerShell v7 preview 5 has a number of new, and some modified experimental features. The full list of PowerShell v7 preview 5 experimental features is: PSCoalescingOperators – – Support the null coalescing operator and null coalescing assignment operator in PowerShell language PSCommandNotFoundSuggestion – – Recommend potential commands based on fuzzy search on a CommandNotFoundException PSErrorView […]

under: PowerShell 7

Older Posts »

Categories