ansible/test/integration/targets/win_find/files/set_share.ps1

8 lines
215 B
PowerShell
Raw Normal View History

2017-02-08 23:19:08 +01:00
$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)