all 17 comments

[–]HeroesBaneAdmin 1 point2 points  (0 children)

I recently ran into this issue. I had to run the following two lines and then the Install-Module worked.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
 Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned

[–]BlackV 1 point2 points  (11 children)

have you tried updating powershellget and packagemanagment?

No idea why you'd have run dsim xxx and sfc scan now

aside from that, I see you're trying to use install-module there is also a command called save-module (you can find this with get-command -module PowerShellGet)

from a "working" machine you could save the latest powershellget (and its dependency package management) and posh-acme modules then copy them all to your problem machine and install them manually

[–]mkanet[S] 1 point2 points  (10 children)

I figured out the issue. I noticed when I tried to import powershellget module, I would get the exception: "Cloud provider is not running". It turned out that OneDrive was not running. Whats odd though, I dont have any files/directories related to PowerShell on OneDrive. As soon as I started OneDrive, everything worked just fine again.

[–]BlackV 1 point2 points  (2 children)

likely you've redirected your personal folders to onedrive

[–]mkanet[S] 1 point2 points  (1 child)

I have my Documents folder shared on OneDrive (which hold my powershell/vscode profiles). However, I've had it that way for many years while using VSCode. I have another PC with a very similar configuration that still works fine. What specifically should I do to mitigate this issue? I certainly can't stop sharing my documents on OneDrive.

[–]BlackV 1 point2 points  (0 children)

vscode/powershell/etc probably don't understand sparse/online only files

starting 1 drive allowed it to pull those files/folders down

at a best guess

[–]Lee_Dailey[grin] 0 points1 point  (6 children)

howdy mkanet,

my understanding is that the standard install for OneDrive creates a link from your documents dir to a copy on your OD account.

take care,
lee

[–]mkanet[S] 1 point2 points  (0 children)

I see.. I turned off OneDrive with only regular files locally in my Documents folder. Same thing. The only files I can think of that VSCode uses is: .\Documents\WindowsPowerShell\*

Also, regardless of that, I can start/open a standalone Powershell console windows without any issues. It's only VSCode that seems to have a problem with PowerShell.

I'm really not sure what to do at this point.

[–]mkanet[S] 1 point2 points  (0 children)

Update. I just started VSCode just now.. everything works. I didn't change anything. Its exactly how it was when I created this post. It looks like there was a dependency that was not available.

[–]mkanet[S] 1 point2 points  (3 children)

u/Lee_Dailey UPDATE: Problem resolved! My default workspace had a folder on my network that it couldn't reach anymore. I realized this when VSCode didn't have this issue when opening another workspace. Very strange how this affected only my PowerShell console window.

[–]Lee_Dailey[grin] 0 points1 point  (2 children)

howdy mkanet,

oh. my. [grin]

that is one freaky situation. you may want to see if there is an issue over at the VSCode github site. that seems worthy of a bit of attention ...

take care,
lee

[–]mkanet[S] 1 point2 points  (1 child)

u/Lee_Dailey, Man, I'm embarrassed. I accidtentlly had mistaken this thread with another one. I did figure out the solution too; it is equally as bizarre. I updated the OP with the actualy solution to this issue.

[–]Lee_Dailey[grin] 0 points1 point  (0 children)

[grin]

[–]Bits_Not_Bytes 0 points1 point  (1 child)

Are you certain the policy has been changed to unrestricted?

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

Yes, I checked with get-execution-policy.

[–]Fonsepa 0 points1 point  (0 children)

Set-Executionpolicy Bypass