It looks like the New-SmbShare cmdlet isn’t respecting the -WhatIf switch.
To reproduce, run
New-SmbShare -Name TempFolder -Path “C:\Temp” -WhatIf
I would not expect the “TempFolder” share to actually be created due to the addition of the WhatIf switch. However, on my server, the share is indeed created as can be seen by running:
Get-SmbShare -Name TempFolder
Is this intended behaviour and, if not, where is the best place to report a bug?
P.S. I am running Windows Server 2012 R2 and PowerShell version 4.0.