Powershell Export-Clixml对象操作
我想能够保存一个对象到文件,然后让另一个脚本再次拿起这个对象,并能够使用它。 我跑 Export-Clixml -InputObject $object -Encoding UTF8 -Path $file 将对象保存到文件,但如果我运行 $object = Import-Clixml $file 我不能像以前那样操纵对象。 示例代码来描述我的问题: #script 1 $objecttofromFile = new-object -com "Microsoft.Update.UpdateColl" foreach ($herp in $derp) { # do stuff, then $null = $objecttofromFile.Add($herp) } ######## stop, save to file ######### #save shiny UpdateColl object to file Export-Clixml -InputObject $objecttofromFile -Encoding UTF8 -Path $file […]