VictorGh

updated

3 years ago

Closed

V

VictorGh

1 Rookie

35 Posts

0

943

May 4th, 2023 10:00

Creating a multi lines Directive with Powershell

Networker Server 19.3

I am trying to create a Directive with multiple lines from a Powershell script

For example, I'd like it to contain the following lines:

<< "c:\temp" >>
skip: *

<< / >>
+compressasm: .

I had partial success, I created a txt file (directive.txt) with the following content:

create type: NSR directive; name:SkipTemp;directive: << "\"c:\\temp"\" >> "skip: *"

I then called it from powershell like this:

cmd.exe /c "nsradmin -i .\src\directive.txt"

It worked, the directive was created, however everything in the directive is on a single line, I need to script a directive with 10 lines and not sure how to achieve it.

Any advice will be appreciated!