I have xl file which i modify but when I try to save it, i get access denied error.
$file = “C:\Temp[Name] Test [Name2] - Name3 = Name4.nfo”
[xml]$data = Get-Content -LiteralPath $file
$data.xml.title = “New name”
$data.Save($file);
Exception calling “Save” with “1” argument(s): “Access to the path ‘C:\Temp[Name] Test [Name2] - Name3 = Name4.nfo’ is denied.”
At line:6 char:1
- $data.Save($file);
-
- CategoryInfo : NotSpecified: (
, MethodInvocationException
- FullyQualifiedErrorId : DotNetMethodException