Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

Other new cmdlets

Some other useful cmdlets included are:

  • Write-Information : A replacement for the Write-Host cmdlet that is consistent with the other Write-* cmdlets in the Microsoft.PowerShell.Utility namespace. See https://blogs.technet.microsoft.com/heyscriptingguy/2015/07/04/weekend-scripter-welcome-to-the-powershell-information-stream/.
  • ConvertFrom-String and Convert-String: The new string parsing functions that create structured data from strings, or parse out string data into structured data. See https://blogs.msdn.microsoft.com/powershell/2014/10/31/convertfrom-string-example-based-text-parsing/.
  • Format-Hex: This cmdlet formats information into hexadecimal.
  • Get-Clipboard and Set-Clipboard: A cmdlet to simplify working with the clipboard, replacing piping to clip.exe.
  • Clear-RecycleBin: This cmdlet empties the Recycle Bin.
  • New-TemporaryFile: Simplifies the creation of temporary files within PowerShell scripts.
  • New-Guid: A wrapper for [GUID]::NewGuid() to simplify the creation of Globally Unique Identifiers (GUIDs). A GUID is an identifier, unique in space and time, that you use in a variety of scenarios. System Center Virtual Machine Manager, for example, uses GUIDs in jobs created by the UI.
  • Enter-PSHostProcess and Exit-PSHostProcess: These enable you to debug PowerShell processes outside the current host process.
  • Export-ODataEndpointProxy: This cmdlet generates a wrapper module for working with an OData endpoint. See https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.odatautils/microsoft.powershell.odatautils.

Explore some of these cmdlets here and in later chapters as well.