dcrt
November 17, 2020, 7:09am
1
Hi Everyone,
I am trying to invoke a powershell code in studio but I can’t set the quotation marks proparly. I have changed most of the " to ’ but this one doesn’t work. I also tried to use slash but couldn’t use it properly. Can you please help? Thank you.
GBK
(GBK)
November 17, 2020, 7:19am
2
@dcrt - have you tried with single quotes instead of double?
dcrt
November 17, 2020, 7:30am
3
I did and it did work for the rest of the project but it doesn’t work with the marked one
try to use “”\$Server\c$“”
dcrt
November 17, 2020, 7:49am
5
sunil_singh1:
“”\Server\c""
I still get a syntax error unfortunately
ptrobot
November 17, 2020, 9:35am
6
Unfortunately, double quotes in a multi line string simply doesn’t work in the Expression Editor.
This is OK:
"The server is ""\Server\c"""
This is not OK:
"The
server
is
""\Server\c"""
The workaround is to use single line strings instead and combine them with Environment.NewLine.
"The" + Environment.NewLine +
"server" + Environment.NewLine +
"is" + Environment.NewLine +
"""\Server\c"""
This works fine for a few lines but becomes unmanageable if there are more.
May I ask why you don’t put the script in a file and invoke the file instead?
2 Likes
dcrt
November 18, 2020, 1:09pm
7
That’s what I had to do eventually, Thank you so much for your time and reply
1 Like
system
(system)
Closed
November 21, 2020, 1:09pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.