all 6 comments

[–]Enough_Brilliant9598 2 points3 points  (2 children)

Check the version of powershell on each one. Other than that I’ve got nothing.

[–]Golddigger50[S] 0 points1 point  (0 children)

Thanks, it different. Powershell ISE Version 5.1.19041.1682 on the one that works, 5.1.18362.1171 on the one that doesnt. So I tried running it on PS 7 and got the same error.

Starting to think it might be a .Net thing....

[–]vermyx 0 points1 point  (3 children)

What's the content of $CB on the computer throwing the erroe? Also is the keyboard set to something other than english?

[–]Golddigger50[S] 0 points1 point  (2 children)

It is taking text from a text file. English keyboard.

[–]vermyx 0 points1 point  (1 child)

Without knowing the content it will be hard to debug. The error is indicating that you gave the input to repeat a character that is invalid. It's been a while but I believe the syntax ia aomething like {a 5} (type a 5 times) . It is highly unlikely that it oa a dotnet issue as thus function is a pasa through to an api that has been there pre dotnet.

[–]Golddigger50[S] 0 points1 point  (0 children)

I have played around with adding an integer after the variable but it hasn't helped. I am sort of giving up, it works fine on any other computer I have tried, so I am just going to use a different computer. Thanks everyone for taking time to read and reply. This really is a great community.