I built a simple GUI powershell script that runs exactly how I want it on many different computers (after installing all the right modules I also tried installing them with the -scope allusers).
when I compile the script using ps2exe it throws errors as if I haven't installed some of the modules I can use on the computer.
I also made sure to import the modules at the top of the script.
I assume this has something todo with scope but I am not sure how to configure the module/exe to be able to see Az.Accounts
Note: the powershell module sqlserver seems to work just fine no issues for the exe to find and use that one.
Edit: I just tested the script with no code other than just importing the module Az.Accounts and Connect-AzAccount. again this script runs just fine before converting with ps2exe
Glad #ryankennedy712 for identifying the cause of the issue and solving yourself. Posting it as answer that would help the community members who will face similar issue.
It was the overriding of previously installed the modules of Az.Accounts with the cmdlet Install-Module Az -scope allusers -allowclobber.
Re-installation (Full Uninstall and Install) of the module Az.Accountsalong with the scope of allusers works successfully.
when I installed sqlserver module it didnt need the all users scope.
There is no scope attribute for installing the SqlServer Module installation for AllUsers in the PowerShell cmdlet. To install that module for all the users in the system, the command should be run in Elevated PowerShell Session (as an administrator) mentioned by Microsoft in this MS Doc.
Related
Which PowerShell module is needed to run the command from the below GitHub sample Individually:
Remove-AzureMFAExpiredBypassUsers
https://github.com/psignoret/ramical-Samples/tree/master/AzureMFAAdminUtils
In the code, you can see the required modules
The required modules are AzureAD and MSOnline
Hope this helps!
I have an application with many serverless functions deployed to AWS lambda. These functions use Python 3.7 runtime environment. But yesterday after deploying some minor changes, few of these functions stopped working with the error.
[ERROR] Runtime.ImportModuleError: Unable to import module 'functions.graphql.lambda.user_balance': No module named 'setuptools._distutils'
The weird thing is that the functions which are throwing this error were not changed and other functions are working without any issues. No python module was added/removed.
Just to check if the code change has anything to do with this error, I tried deploying a previous version. But the error persists.
I used the serverless framework for deployment.
It looks like this is an issue that started happening for all Python users as of yesterday as the set up tools got updated, but PIP did not.
According to this GitHub issue there is a temporary workaround until this is actually fixed.
Setting environment variable SETUPTOOLS_USE_DISTUTILS=stdlib is a workaround, e.g.:
export SETUPTOOLS_USE_DISTUTILS=stdlib
pip3 install ....
My assumption would be that you could add this as an environment variable for the Lambda possibly through the serverless config?
This is the bug in setuptools https://github.com/pypa/setuptools/issues/2353. Follow the below temporary workaround.
Linux
export SETUPTOOLS_USE_DISTUTILS=stdlib
Windows
set SETUPTOOLS_USE_DISTUTILS=stdlib
After that, execute the pip command.
pip install XXXXX
I come here to solve this problem: I have installed node (Ver. 12.13.1) in my computer, then I use node -v to see if node are well installed, and yes, it is.
Later, I use npm install #vue/cli, it installs the framework, but when a do a vue --version throws me a error.
I have tried in the terminal of visual studio code and throws me the error too. I tried uninstall and install node, and do the before stuff again, but its not working, the error remains
What could I do? Why is this happening?
Error in english:
Cannot load file C:\Users\halva\AppData\Roaming\npm\vue.ps1.
The file C:\Users\halva\AppData\Roaming\npm\vue.ps1 is not digitally signed.
You cannot run this script on the current system.
For more information about the execution of scripts and execution policy settings,
see about_Execution_Policies at https: /go.microsoft.com/fwlink/?LinkID = 135170
Photos of the code:
PS Terminal and
Visual Studio Code Terminal
Can confirm this is a powershell issue:
Please read this github issue on the matter: https://github.com/vuejs/vue-cli/issues/3424
People have suggested getting the same issue with vue-cli installed globally.
Solution: delete the erroring file: File C:\Users\halva\AppData\Roaming\npm\vue.ps1.
Sidenote:
What I suggest is to not use powershell, and use something like gitbash: https://gitforwindows.org/ (but this is entirely an opinion)
this command help to get rid off error message and execute the command, I am sharing here for help, looks like you should be sure whatever libraries you are using they are safe for your computer.
>Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Source https://github.com/vuejs/vue-cli/issues/3424
You should install vue-cli globally
npm install -g #vue/cli
I'm setting up an Azure DevOps self hosted pipeline agent. We have some legacy cloud services, so we need the "old" Azure powershell module that targets the service management API. We also obviously use Azure Resource Manager, so either the AzureRM or the new Az module is also required.
We currently have the Azure module version 5.3.0 and AzureRM module version 6.13.1 being installed using the following commands:
Install-Module -Name Azure -RequiredVersion 5.3.0 -AllowClobber -Scope AllUsers -Force
Install-Module -Name AzureRM -RequiredVersion 6.13.1 -AllowClobber -Scope AllUsers -Force
The problem we're encountering is that, depending on the order these modules are imported, we will get script failures. If, for example, the order of import is Azure followed by AzureRM, we get the following error:
Import-Module : The following error occurred while loading the
extended type data file: Error in TypeData
"Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer":
The TypeConverter was ignored because it already occurs. Error in
TypeData
"Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer":
The member SerializationDepth is already present. Error in TypeData
"Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache":
The member PropertySerializationSet is already present. Error in
TypeData
"Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache":
The member SerializationMethod is already present. Error in TypeData
"Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache":
The member PropertySerializationSet is already present. Error in
TypeData
"Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache":
The member SerializationMethod is already present. Error in TypeData
"Microsoft.Azure.Commands.Profile.Models.PSAzureContext": The member
SerializationDepth is already present. Error in TypeData
"Microsoft.Azure.Commands.Profile.Models.PSAzureProfile": The member
SerializationDepth is already present. At C:\Program
Files\WindowsPowerShell\Modules\AzureRm\6.13.1\AzureRM.psm1:81 char:1
+ Import-Module AzureRM.Profile -RequiredVersion 5.8.2 -Global
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-Module], RuntimeException
+ FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
You can see this in the following screen shot:
But if import AzureRm first, followed by Azure, it appears to work fine:
The problem is, we don't control the order of the imports when using existing pipeline tasks built by Microsoft and others. We're getting failures deploying our cloud services due to the fact the cloud service deployment task built by MS happens to import Azure first.
Lastly, I tried simply not installing the old Azure module, hoping that AzureRM "came with" what it would need to handle some service management API tasks, but it does not. If I try do a deployment without the Azure module installed, we get the error:
Certificate based authentication is not supported. Azure PowerShell
module is not found.
So it appears the legacy module is required, and yet it conflicts.
This appears to be caused by the order of installation. Flipping the order from Azure then AzureRm to AzureRm then Azure resolved the issue. So the following install commands do not result in the problem:
Install-Module -Name AzureRM -RequiredVersion 6.13.1 -AllowClobber -Scope AllUsers -Force
Install-Module -Name Azure -RequiredVersion 5.3.0 -AllowClobber -Scope AllUsers -Force
It appears the root cause is that the Azure module, if installed first, will always install the most recent version of AzureRm.profile. This appears to be caused by the Azure.Storage module, which has a dependency on AzureRm.profile.
If you install the Azure module first, it will install AzureRm.profile version 5.8.3. When you then install AzureRm, it has a dependency of AzureRm.profile as well, but it will ignore the fact that you already have AzureRm.profile v5.8.3 installed and install AzureRm.profile v5.8.2. I believe this is because while the Azure module has a dependency on AzureRm.profile, the AzureRm module includes AzureRm.profile.
When Import-Module is called for Azure first, it loads v5.8.3 of the AzureRm.profile module, as it will always load the most recent version by design. When, however, AzureRm itself is loaded, it tries to load the version IT came with (v5.8.2), and this fails due to the type error noted in the question.
If you install AzureRM before Azure, it prevents this from happening. Since when the Azure module is being installed it sees there is already a version of AzureRm.profile that satisfies its dependency (or, more specifically, satisfies the dependency that Azure.Storage has), it doesn't install AzureRm.profile again. This leaves only the version that AzureRm was packaged with, and everything is fine.
Lastly, for an existing "broken" environment, running this command resolved the problem:
Uninstall-Module -Name AzureRM.profile -RequiredVersion 5.8.3
I'm trying trying to use a node module inside my Azure Functions project. I've tried following these instructions several times but still can't use the module I'm trying to bring in.
After bringing in my package.json and running npm install, I can see the node_modules folder (actual modules are located in node_modules/.staging). Upon restarting the function and trying to run it, I get Error: Cannot find module '_____'.
I'm following the instructions correctly. Any suggestions on how to get the modules to work?
You did everything correctly, after npm install, please wait for some time. Modules being in ./staging folder means the installation is still in progress.
You will see added packages prompt in console after the installation is finished.
Update--Avoid long time waiting for module install.
As #brettsam mentioned in comment, with azure-functions-pack tool(also a module), we can place all the modules in a single file, no need to install online and wait. You can search for your function name to find your function scripts if you want to edit after publication.