Powershell started via blueprism does not load installed packages - powershell

I am launching PowerShell via blueprism and need to change the expiration date on some users.
I have the packages installed on the machine and can run the code if I open PowerShell outside of the blueprism environment.
Blueprism start location is "C:\Program Files\Blue Prism Limited\Blue Prism Automate"
Local PowerShell starts in network drive "G:" where the packages are installed.
I have tried to change the location, but it does not help.
Elevated permission is not the problem and I have checked that the code works.
This is the error message: Set-ADAccountExpiration : The 'Set-ADAccountExpiration' command was found in the module 'ActiveDirectoryModule', but the module could not be loaded.
EDIT NOTE: I'm launching blueprism via the
application modeler.

Related

Powershell commands/scripts not actually running

I am trying to install Emscripten on my computer, and I have run into trouble getting Emscripten actually installed.
I am using the same commands as can be found on the project webpage, but when I try to run
emsdk install latest
Powershell (which is what I am using, but the basic command prompt is behaving the same way) doesn't do anything at all - it just returns without installing anything.
For reference, I have installed Emscripten on this same computer before, but decided to try and do a fresh install of Emscripten after running emsdk activate latest decided to "stop working" as well (whereas it worked just fine last week) - running the command, Powershell simply returned without actually doing anything.
Any ideas on what to check to see why these commands don't seem to run?
I think I solved it. When running the install command in Powershell ISE, it threw the error "Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640"
despite me having Python installed. Changing the order of my PATH variables to set my Python install directory above the Winapps directory solved the issue with running the install command.

Failed to run AzureAD Module PowerShell commands inside windows container

I am trying to run AzureAD Module PowerShell commands inside windows container but due its dependency with "IEFRAME.DLL" its throwing error
I also tried by copying dll inside container to windows system folder but it still complains
Is there any workaround or hack available to get it work inside windows container?

Automatically start AWS module when VSCode is started

Is it possible to have the AWS SDK module loaded once VS Code starts?
Running on OSX, VSCode has the PowerShell extension installed and working.
In a terminal I can type "powershell" and it automatically loads the AWS module because "Microsoft.PowerShell_profile.ps1" has
Import-Module AWSPowerShell.NetCore
Set-DefaultAWSRegion -Region eu-west-1
in there so they are loaded once I start PowerShell.
I was hoping to have the same in VSCode and not having to add these 2 lines inside the PowerShell script(s).
You can add your modules and scripts to launch.json to facilitate this.
More detail can be found at the following link:
https://blogs.technet.microsoft.com/heyscriptingguy/2017/02/13/debugging-powershell-script-in-visual-studio-code-part-2/

How to Connect to Azure from Visual Studio Code Terminal

I have installed the required software and Azure PowerShell cmdlets on local system. I tried to execute a powershell script by connecting to Azure from Visual Studio Code Terminal. Below is the error.
Import-Module Microsoft.Online.SharePoint.PowerShell
function PublishToAzure{
Add-AzureAccount
......
......
}
Error is..
Add-AzureAccount : The handle is invalid
Visual Studio Code Settings:
// Place your settings in this file to overwrite the default settings
{
"terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
}
Console of Windows Azure Active Directory Module for Windows PowerShell Properties
Target is:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command "Import-Module MSOnline"
System Properties: 64bit Win7 OS
You may connect and manage Azure resources from within VS Code's terminal window by installing Microsoft Azure CLI 2.0. (https://aka.ms/InstallAzureCliWindows).
After CLI 2.0 is successfully installed in your environment, add the CLI 2.0 components to your environment path.
For example, my environment is Windows 10 and VS Code v1.13.0. I successfully ran the CLI 2.0 MSI installer for Windows. In my VS Code terminal session, I add the path to my PowerShell environment via this command:
$Env:Path += ';C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin'
To work within my Azure subscription(s), first I login via the command
az login
Follow the prompts to browse to a URL to complete the login to your Azure account and authorize the CLI session. Additional help on CLI 2.0 commands may be found at this link, https://aka.ms/cli
I know this thread is old and my answer a bit late but I hope this helps someone.
Cheers,
CarnegieJ

Enabling app sideloading using NSIS on Windows10

I have a Windows Universal App that needs to be sideloaded. I am using NSIS with a powershell script to install it. I would like to have the NSIS installer enable app sideloading in the Windows settings. I have already looked at the documentation from Microsoft about enabling app sideloading (https://msdn.microsoft.com/library/windows/apps/xaml/dn706236.aspx).
If I run the powershell command from the documentation to set the registry in a standalone powershell window it works fine and I can install the app. However, when I put the registry command inside the installer it doesn't work. I have tried using both Powershell and NSIS to set the registry. Using the WriteRegDWORD command from NSIS and the reg add command from Powershell both say that they succeeded. Reading back the values produces the correct value. If I try to set the registry using Set-ItemProperty in the Powershell script it complains that the path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock doesn't exist.
There doesn't seem to be any way to tell whether sideloading is enabled or not from Powershell. Even outside of the installer context checking the registry is not a valid solution because enabling sideloading via Windows Settings doesn't set the registry.
So my current solution is to try to install the app. If the install fails, check the error message and see if it's complaining about sideloading not being enabled. If that is the case then open up Windows Settings to the developer features page and pop up a message saying that sideloading needs to be enabled in order to continue. Then after Windows Settings is closed reattempt to install the app.
Is it possible to enable sideloading from an NSIS installer? Or is it possible to do a check to see if sideloading is enabled or not?
64-bit versions of Windows have a 64-bit and a 32-bit "version" of the registry, this means that what you see in Regedit might not be the same as what a 32-bit application sees.
Use the SetRegView instruction to change the view used by the installer.
Process Monitor is a useful tool to debug registry issues like this...