mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
8 lines
215 B
PowerShell
8 lines
215 B
PowerShell
|
$share_name = $args[1]
|
||
|
$share_stat = Get-WmiObject -Class Win32_Share -Filter "name='$share_name'"
|
||
|
If ($share_stat) {
|
||
|
$share_stat.Delete()
|
||
|
}
|
||
|
$wmi = [wmiClass] 'Win32_Share'
|
||
|
$wmi.Create($args[0], $share_name, 0)
|