这是我尝试过的:
$a = (Get-ItemProperty -Path .\Desktop.ini -Name Attributes).Attributes
Set-itemproperty -Path .\Desktop.ini -Name Attributes -Value ($a -bor [System.IO.FileAttributes]::System)
但属性没有改变(Get-itemproperty -Path .\Desktop.ini -Name Attributes).attributes)
返回“正常”。