Optimize-Offline icon indicating copy to clipboard operation
Optimize-Offline copied to clipboard

[BUG] Script can only be used once

Open truefriend-cz opened this issue 4 years ago • 1 comments

After the first run, the script modifies the path in the Configuration.json file where it adds more slashes and scritp cannot be run again.

Before first script run path in Configuration.json is: "SourcePath": "G:\sources\install.wim" and script running is ok.

After final script auto changed file Configuration.json to: "SourcePath": "G:\\sources\\install.wim" and the script can no longer be run because it ends up in error "Path is nulled".

Would it be possible for the script not to auto modify the Configuration.json file?

truefriend-cz avatar Feb 23 '20 18:02 truefriend-cz

It changes the SourcePath because JSON-formatted URLs are required to have double forward-slashes, hence why the Start-Optimize.ps1 call script has a Try/Catch block that catches an error in the JSON format and automatically adds the additional forward-slash in the URL before it is attempted to be used as an import configuration file. Moreover, since the double-forward slashes in the URL is the proper formatting for JSON, it would not return a 'Path is nulled" unless the path truly does not exist.

If possible, post the complete error returned to you.

DrEmpiricism avatar Mar 09 '20 04:03 DrEmpiricism