Dot Sourcing from UNC path - PS Studio Editor/Intelisense

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 2 years and 1 month 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.
jamie.dobbs
Posts: 23
Last visit: Fri Oct 06, 2023 12:49 am

Dot Sourcing from UNC path - PS Studio Editor/Intelisense

Post by jamie.dobbs »

Code: Select all

Product:  PowerShell Studio 2022 (64 Bit)
Build:    v5.8.198
OS:       Windows 10 Pro (64 Bit)
Build:    v10.0.19043.0
Hi,

Not sure if I'm doing something wrong or if it's a limitation of Powershell Studio but i have noticed if i use dot sourcing from my local drive the PS Studio Intellisense recognises Functions and Parameters from the sourced file.

If however, I host that file I'm dot sourcing on a network share and access it via UNC (\\Server_Name\Share\File.ps1) then the Functions/Parameters don't get recognised in the PS Editor, the functions remain grey and it doesn't provide the tab completion.

It does still work when i run the script, i just don't get the helpful syntax highlighting and auto completion.
I thought maybe dot sourcing in general doesn't like UNC paths but when doing it in the PS terminal or PS ISE it works and auto-completes fine.

Is it possible for the PS Studio to work with UNC paths?

Regards,
Jamie
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Thu Mar 28, 2024 6:54 am
Answers: 39
Been upvoted: 30 times

Re: Dot Sourcing from UNC path - PS Studio Editor/Intelisense

Post by brittneyr »

We are looking into this and will get back to you soon.
Brittney
SAPIEN Technologies, Inc.
jamie.dobbs
Posts: 23
Last visit: Fri Oct 06, 2023 12:49 am

Re: Dot Sourcing from UNC path - PS Studio Editor/Intelisense

Post by jamie.dobbs »

brittneyr wrote: Wed Jan 19, 2022 9:06 am We are looking into this and will get back to you soon.
Thank you
jamie.dobbs
Posts: 23
Last visit: Fri Oct 06, 2023 12:49 am

Re: Dot Sourcing from UNC path - PS Studio Editor/Intelisense

Post by jamie.dobbs »

Just wanted to update to advise of the new version info since the 24th update

Code: Select all

Product:  PowerShell Studio 2022 (64 Bit)
Build:    v5.8.199
OS:       Windows 10 Pro (64 Bit)
Build:    v10.0.19043.0
The reported issue is still present in this version too.
I didn't expect it to be fixed as nothing has been mentioned on this thread or in the update changelog but just wanted to update you.

Thank you.
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Thu Mar 28, 2024 6:54 am
Answers: 39
Been upvoted: 30 times

Re: Dot Sourcing from UNC path - PS Studio Editor/Intelisense

Post by brittneyr »

From my initial tests, I have not found any issues when dot sourcing a network file with a UNC path:
SPS_DotSourceUNC.png
SPS_DotSourceUNC.png (40.75 KiB) Viewed 4751 times
PowerShell Studio is a .NET application, but the component running scripts is not. If it is a .NET issue, then it is most likely either a permission issue or the request timed out with the file on your network share.

Can you try running PowerShell Studio as an administrator?
Brittney
SAPIEN Technologies, Inc.
jamie.dobbs
Posts: 23
Last visit: Fri Oct 06, 2023 12:49 am

Re: Dot Sourcing from UNC path - PS Studio Editor/Intelisense

Post by jamie.dobbs »

Hi,

I have just tried running as Administrator but that hasn't helped.

When I dot source from c:\users\... it works fine and I see the Functions pane populate with the functions from my file.
That doesn't happen from \\my-server\my-share\...

I also tried changing the path to my local drive from c:\users\... to \\my-pc-name\c$\users\... and this also doesn't work.

I did test mapping a network location to a drive letter but that didn't work either so maybe it's not related to UNC per se but rather any network location?
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Thu Mar 28, 2024 6:54 am
Answers: 39
Been upvoted: 30 times

Re: Dot Sourcing from UNC path - PS Studio Editor/Intelisense

Post by brittneyr »

The image posted in my previous post is on a network location. It sounds like PowerShell Studio's editor cannot assess files on your network at all.

I'll see what else can be done and update you when I have more information.
Brittney
SAPIEN Technologies, Inc.
jamie.dobbs
Posts: 23
Last visit: Fri Oct 06, 2023 12:49 am

Re: Dot Sourcing from UNC path - PS Studio Editor/Intelisense

Post by jamie.dobbs »

Think I found the issue.

In a previous post i had an issue with the editor freezing and to help i had disabled "Enable remote file status check"
viewtopic.php?p=80294&hilit=enable+remote+file#p80294

I have just enabled that setting again and that appears to have done the trick.
This topic is 2 years and 1 month 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.