我得到的数据如下
Path : C:Program Filesibmgsk8lib64
ModifiablePath : C:Program Filesibmgsk8lib64
IdentityReference : BUILTINAdministrators
Permissions : {WriteOwner, Delete, WriteAttributes, Synchronize...}
Path : C:Program Filesibmgsk8bin
ModifiablePath : C:Program Filesibmgsk8bin
IdentityReference : BUILTINAdministrators
Permissions : {WriteOwner, Delete, WriteAttributes, Synchronize...}
必须使用format - list因为没有这个,最后一列权限是看不见的。当我尝试Export-csv获取数据时,最后一列显示为System。对象[]请告诉我如何将这些数据写入csv
使用Select-Object
创建一个新的计算属性:
... |Select-Object Path,ModifiablePath,IdentityReference,@{Name='Permissions';Expression={$_.Permissions -join ';'}} |Export-Csv -Path pathtooutput.csv -NoTypeInformation