Bug if Path to ps1-Script contains '&'

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
Jehoschua
Posts: 64
Last visit: Fri Mar 01, 2024 3:24 am

Bug if Path to ps1-Script contains '&'

Post by Jehoschua »

Product, version and build: PowerShell Studio 2017 v5.4.143
32 or 64 bit version of product: 64
Operating system: Win10
32 or 64 bit OS: 64

Good afternoon

PowerShell itself has no problems to run this script containing ampersands:

Code: Select all

A:\Scripts\Backup&Reset-Outlook\Backup&Reset-Outlook.ps1
It's really very annoying that PowerShell Studio is reserving some usual(!) Filesystem characters "for future use": it stops working:

Code: Select all

+ A:\Scripts\Backup&Reset-Outlook\Backup&Reset-Outlook.ps1
+                                       ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks ("&") to pass it as part of a string.>> Script Ended
Could you please fix this problem?
If you are forced "sometimes in the future" to change the meaning of a usual filesystem character then you still can think about to stop PowerShell Studio to do its work. But it's pretty sure that such hacks are a bad idea in the future, too.

kind regards,
Thomas
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Bug if Path to ps1-Script contains '&'

Post by Alexander Riedel »

I am not sure how you got the idea we have anything to do with that. It is a PowerShell error message and we cannot fix anything in PowerShell.
A simple google search for the error retrieves plenty of documentation regarding the issue.
https://www.google.com/search?q=The+amp ... e&ie=UTF-8

Maybe you should start here: https://stackoverflow.com/questions/188 ... characters

Good luck.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 6 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.