Product, version and build: PSS 5.7.174
32 or 64 bit version of product:64
Operating system:win10 1909
32 or 64 bit OS:64
Im getting some strange behaviour in a few of my function calls. For example here's what it looks like normally (pss1):
Note that it appears that there are two or more spaces between the function call and the parameter when there is in fact only one.
When I place my cursor to the right of the 't' in Add-SQLRequest and left click, here's what it looks like (pss2):
When I place my cursor at the left of 'Add' and hold and start dragging as if to select it looks like this (pss3):
Note the space between the 'R' and 'e'.
This only happens on a small handful of function calls. Most behave normally as you would expect.
To fix this I place my cursor just to the left of the '$', hit backspace and then the space bar. The behaviour goes away.
However if I fix it and save then re-open, the problem comes back.
It doesnt affect the function call - its just weird.
Thanks
David
Strange text behaviour
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.
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.
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Re: Strange text behaviour
I have seen something like this many many years ago in (a galaxy far far ...never mind) another editor.
Back then it was a weird character or character sequence that somehow got inserted into the file and made it appear that there was an extra space. It was not a printable character, so the editor just rendered it as white space. I cannot know if this is something similar, but it would help if you could zip (important!) the file in question and send it to us or upload it.
I'd like to look at it with a hex viewer and check what's going on. It obviously would be helpful if you could point out the exact places where you see that behavior.
Back then it was a weird character or character sequence that somehow got inserted into the file and made it appear that there was an extra space. It was not a printable character, so the editor just rendered it as white space. I cannot know if this is something similar, but it would help if you could zip (important!) the file in question and send it to us or upload it.
I'd like to look at it with a hex viewer and check what's going on. It obviously would be helpful if you could point out the exact places where you see that behavior.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Strange text behaviour
Thanks for your prompt reply. I also thought it was some weird hex character but that doesnt quite explain that when I fix it/save/reopen it re-appears.
Unfortunately I work for a secretive govt department and they not allow code of any sort outside our network.
If you can suggest a free hex editor, Ill take a look myself and get back to you.
Cheers
David
Unfortunately I work for a secretive govt department and they not allow code of any sort outside our network.
If you can suggest a free hex editor, Ill take a look myself and get back to you.
Cheers
David
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Re: Strange text behaviour
PrimalScript. The trial will do it.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Strange text behaviour
This is strange. I opened the psf file that has a problem as binary in primalscript. The problem 'space' character in primalscript is a normal hex '20'. IOW it all looks fine in Primalscript but goes wonky when opened in PS Studio.
Re: Strange text behaviour
I just saw something that may explain this. I noticed that the weird behaviour was occurring on some function calls only. I have a file for all my projects called commonfunctions.ps1 where these functions reside. What I noticed was that when I go to type one of these 'weird' functions, the intellisense displays two versions of the same name - one with red cube thing next to it and one with a blue rectangle thing with a white circle. Im assuming that the red-cube means it comes from my commonfunctions file so I wondered where its getting the other one. As it happens I also have a PSM1 module file with the function of the same name. So PS studio must have enumerated that and then started to exhibit this weird behaviour. Thing is that my psm1 file has been there forever and its only recently that I noticed this behaviour.
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Re: Strange text behaviour
Hmm, interesting. I will make sure the team looks into this. Thanks.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- stephanied
- Posts: 13
- Last visit: Thu Apr 08, 2021 8:55 am
Re: Strange text behaviour
We are working on replicating this behavior. I have attached a sample project, could you tell me what is different about this setup compared to yours?
Thanks,
Stephanie Dennis
SAPIEN Technologies, Inc.
Thanks,
Stephanie Dennis
SAPIEN Technologies, Inc.
- Attachments
-
- StrangeForumTest1.zip
- (34.84 KiB) Downloaded 98 times
Re: Strange text behaviour
With your attached project when you start typing the function 'write-stringtest1', the intellisense only lists one version of that function where mine lists two.
The difference probably is that my psm1 file is not in the project but is in a module located within c:\windows\system32\windowspowershell\v1.0\mymodule
Also, when I look at the object browser I can see my module.
Thanks
David
The difference probably is that my psm1 file is not in the project but is in a module located within c:\windows\system32\windowspowershell\v1.0\mymodule
Also, when I look at the object browser I can see my module.
Thanks
David
Re: Strange text behaviour
Are you looking to fix this or should I change the names of my functions so that they are not duplicated between the commonfunctions file I use in my project and the PSM1 file in the standard module location?