PrimalScript PowerShell user profile

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
fr3288
Posts: 23
Joined: Sun Jan 28, 2007 1:37 am

PrimalScript PowerShell user profile

Post by fr3288 » Wed Jan 30, 2019 1:19 pm

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

User avatar
fr3288
Posts: 23
Joined: Sun Jan 28, 2007 1:37 am

Re: PrimalScript PowerShell user profile

Post by fr3288 » Wed Jan 30, 2019 2:05 pm

One additional note. In PrimalScript the PowerShell cache editor shows Quest.ActiveRoles.ADManagement version 1.6.0.2683 box checked.

User avatar
Olga_B
Site Admin
Posts: 120
Joined: Mon May 15, 2017 9:06 am

Re: PrimalScript PowerShell user profile

Post by Olga_B » Wed Jan 30, 2019 6:06 pm

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

User avatar
Alexander Riedel
Posts: 7054
Joined: Tue May 29, 2007 4:43 pm

Re: PrimalScript PowerShell user profile

Post by Alexander Riedel » Thu Jan 31, 2019 5:37 am

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.
Alexander Riedel
SAPIEN Technologies, Inc.