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

10 lines
208 B
PowerShell
Raw Normal View History

2017-02-08 23:19:08 +01:00
$path = $args[0]
$attr = $args[1]
$item = Get-Item "$path"
$attributes = $item.Attributes -split ','
If ($attributes -notcontains $attr) {
$attributes += $attr
}
$item.Attributes = $attributes -join ','