You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/win_stat/files/set_attributes.ps1

10 lines
208 B
PowerShell

$path = $args[0]
$attr = $args[1]
$item = Get-Item "$path"
$attributes = $item.Attributes -split ','
If ($attributes -notcontains $attr) {
$attributes += $attr
}
$item.Attributes = $attributes -join ','