1

Im executing a Powershell Script within a .bat file. To make it better readable i want to separate the command with new line. In powershell it is the Character ´. That seems not to be working in a batchfile. I want to make the following:

powershell -Executionpolicy ByPass -NoProfile -Command "Import-Csv .\outfit-verfuegbarkeit-temp.csv -delimiter ';' | ForEach-Object {if ($_.Inventory -like 'New') {$_.Inventory = '0'} $_} | Export-Csv .\outfit-verfuegbarkeit-temp2.csv -delimiter ';' -NoTypeInformation"

Does anyone have an idea what character it is to ignore the new line?

Regards Hubertus

Alex
  • 49
  • 5
  • 1
    1. Could you please [format your code](https://stackoverflow.com/help/formatting) properly? 2. Why not using a proper PowerShell script instead? There you can add several line breaks to make the code more readable. `¯\_(ツ)_/¯` – Olaf Aug 13 '23 at 12:44
  • 1
    In short: you cannot use overall `"..."` enclosure and must end each interior line with `^` and explicitly separate all statements with `;`. See the linked duplicate for details. – mklement0 Aug 13 '23 at 13:15
  • 1
    Time to make a powershell script. – js2010 Aug 13 '23 at 15:42

0 Answers0