Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

Anhang an Datei

$
0
0

Hallo zusammen!

Wenn mir jemand weiterhelfen könnte wäre ich äußerst dankbar. Bin relativ grün hinter den Ohren was PowerShell betrifft, hab mir allerdings durch Suchfunktionen etc. ein Skript zusammengebaut, welches funktioniert. Was nicht funktioniert und eine Fehlermeldung auswirft ist wie folgt im Bild zu sehen... Mir wäre sehr geholfen, diesen Fehler zu beheben. Komme leider aufgrund mangelnder Fachkenntnisse bezüglich PowerShell nicht weiter...

Die Ergänzung am Schluss funktioniert leider nicht :-(

$original_file = 'C:\Users\theo_\Documents\Seite_Rechts_2_1.xcs' $destination_file = 'C:\Users\theo_\Documents\Seite_Rechts_2_1.xcs' (Get-Content $original_file) | Foreach-Object { $_ -replace "SetWorkpieceSetupPosition\(0.0000, 0.0000, 0.0, 0.0\)","SetWorkpieceSetupPosition(5.0000, 5.0000, 0.0, 0.0)" } | Set-Content $destination_file (Get-Content $original_file) | Foreach-Object { $_ -replace "SetApproachStrategy\(true, false, -1\)","SetApproachStrategy(false, true, 2)" } | Set-Content $destination_file (Get-Content $original_file) | Foreach-Object { $_ -replace "SetRetractStrategy\(true, false, -1, 0\)","SetRetractStrategy(false, true, 2, 0)" } | Set-Content $destination_file $Ergaenzung = @' CreateNullOperation("Wegfahrschritt", 2000.0000, 0.0000, 1); ResetPneumaticHood(); ResetApproachStrategy(); ResetRetractStrategy(); '@ $ReplacedContent[0..($ReplacedContent.Length - 6)] + $Ergaenzung + $ReplacedContent[($ReplacedContent.Length - 5)..($ReplacedContent.Length)] | Set-Content -Path $destination_file -Force


Viewing all articles
Browse latest Browse all 2314


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>