Search This Blog

Use $WhatIfPreference in PowerShell to Prevent Accidents

  • The default value of $WhatIfPreference variable is $false.
  • Adding “$WhatIfPreference = $true” to a script or the PowerShell profile
  • Now every cmdlet that supports a whatif switch will execute as the whatif switch is on
  • To overwrite the setting in a particular cmdlet, add –whatif:false in the cmdlet

No comments:

Post a Comment

Use WinSCP to Transfer Files in vCSA 6.7

This is a quick update on my previous post “ Use WinSCP to Transfer Files in vCSA 6.5 ”. When I try the same SFTP server setting in vCSA 6.7...