Unable to execute Powershell Scripts from Visual Studio 2017

Issue #49 resolved
Former user created an issue

I am running visual Studio 2017 Community 15.9.4 and Powershell tools for Visual Studio version 4.1.3

I was able to right click on my powershell script project and click execute as script. And it would work fine. Including doing the login-azurermaccount and bringing up the popup box for me to log in. Now since Wednesday probably not long after i updated my visual studio i can no longer do anything with my powershell script projects. I get error messages like the below. I know i have the modules installed, because i can take the same code and run it in a normal powershell session outside of Visual studio.

Login-AzureRmAccount : The 'Login-AzureRmAccount' command was found in the [ERROR] module 'AzureRM.Profile', but the module could not be loaded. For more [ERROR] information, run 'Import-Module AzureRM.Profile'.

or

When i run the import-module as suggested above, i get this.

Import-Module : Could not load file or assembly 'file:///C:\Program [ERROR] Files\WindowsPowerShell\Modules\AzureRM.Profile\5.8.2\Newtonsoft.Json.dll' or [ERROR] one of its dependencies. The system cannot find the file specified.

I know the file is there. Any help is greatly appreciated.

PS C:\WINDOWS\system32> $PSVersionTable

Name Value
---- -----
PSVersion 5.1.17134.407
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17134.407
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Comments (1)

  1. Log in to comment