Esta função do PowerShell deve funcionar:
Function NEW-SHARE ($Foldername, $Sharename) {
# Test for existence of folder, if not there then create it
#
IF (!(TEST-PATH $Foldername)) {
NEW-ITEM $Foldername -type Directory }
# Create Share but check to make sure it isn’t already there
#
If (!(GET-WMIOBJECT Win32_Share -filter “name=$Sharename”) {
$Shares.Create($Foldername,$Sharename,0)}
}
O seguinte artigo sobre technet fornece mais informações: