Page 1 of 1

PrimalScript PowerShell user profile

Posted: Wed Jan 30, 2019 12:19 pm
by fr3288
Product, version and build: PrimalScript 2019 Build 7.4.124
32 or 64 bit version of product: 64 Bit
Operating system: Windows 10 Enterprise version 1709 (Build 16299.904)
32 or 64 bit OS: 64 Bit

I just moved to a Windows 10 computer. I was using Windows 7 64 bit without problems. Now in Windows 10, PrimalScript Powershell user profile does not seem to be loading correctly.

My Windows PowerShell and my PrimalScript profiles are the same but PrimalScript does not load my variables and does not load the Quest AD Cmdlts 1.6.0. PrimalSence recognizes the Quest AD Cmdlts but PrimalScript does not recognize them when I run the script.

If I add Add-PSSnapin Quest.ActiveRoles.ADManagement at the beginning of the script PrimalScript recognize them and the scripts run fine. This line is included in my profile files. Also, executing $Profile does not produce any output. Everything works fine using Powershell from the command Window.

My Microsoft.PowerShell_profile.ps1 and PrimalScript.profile.ps1 are located in C:\Users\UserName\Documents\WindowsPowerShell.

Any ideas what could be wrong?

Thanks,

FR

Re: PrimalScript PowerShell user profile

Posted: Wed Jan 30, 2019 1:05 pm
by fr3288
One additional note. In PrimalScript the PowerShell cache editor shows Quest.ActiveRoles.ADManagement version 1.6.0.2683 box checked.

Re: PrimalScript PowerShell user profile

Posted: Wed Jan 30, 2019 5:06 pm
by Olga_B
Do you have Quest installed on the Windows 10 computer?

Do you see Quest.ActiveRoles.. under PowerShell/64bit/SnapIns in the Object Browser?

In the CacheEditor uncheck, and check back box for Quest.ActiveRoles... and click button Build Cache

Let me know if it solve the problem

Re: PrimalScript PowerShell user profile

Posted: Thu Jan 31, 2019 4:37 am
by Alexander Riedel
Oh my, I didn't think anyone still used that old PrimalScript profile, otherwise I would have built in a warning.
PrimalScript and PowerShell Studio do not use profiles to run scripts anymore.
Profiles are convenient and useful for a console, because it establishes a defined environment tailored to your needs.
If you develop scripts however, you want as little dependency on a specific environment as possible.

So you should just add your snapins or modules to your script as needed and not rely on a specific profile.
My apologies of any inconvenience that may cause.