HELP: PowerShell 5.1 / 5.0 What’s New (and More) – Part 4 Variables

The good news about system variables in Windows PowerShell is that only one new (preference) variable $InformationPreference is added starting with PS 5.0. It has a default value of SilentlyContinue and is listed in the about_Preference_Variables Help file (PS 5.1). You use this mainly to control how the new PS 5.x Write-Information cmdlet behaves. Of note is that Write-Host is a wrapper for Write-Information beginning with PS 5.0. However, the $InformationPreference variable only affects the latter cmdlet.

Desired State Configuration is a new feature introduced in PowerShell 4.0. The about_Automatic_Variables help file in PS 5.1 lists this $AllNodes variable where it automatically becomes available in the scope of a DSC configuration document when passed using the -ConfigurationData parameter. As a side note, you may be interested to know that development of DSC resources using the new class feature is possible starting in PS 5.0.

REFERENCES

– Writing a custom DSC resource with PowerShell classes (TechNet)

 

Leave a Reply