Create a Folder Share

$Shares=[WMICLASS]'WIN32_Share'
$sd = ([WMIClass] "Win32_SecurityDescriptor").CreateInstance() 
$shares.create($FolderPath, $ShareName, 0, 100, "Description", "", $sd)
Details
Return all the domain and forest level FSMO roles.

Example
PS C:\> $FolderPath = 'C:\PSScripts\Share'
>> $ShareName='ScriptFiles$'
>> $Shares=[WMICLASS]'WIN32_Share'
>> $sd = ([WMIClass] "Win32_SecurityDescriptor").CreateInstance()
>> $shares.create($FolderPath, $ShareName, 0, 100, "Description", "", $sd)



__GENUS          : 2
__CLASS          : __PARAMETERS
__SUPERCLASS     :
__DYNASTY        : __PARAMETERS
__RELPATH        :
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
ReturnValue      : 0
PSComputerName   :