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 LICENSE NUMBERS, ACTIVATION 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.
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
fr3288
Posts: 23
Last visit: Fri Sep 18, 2020 1:20 pm

PrimalScript PowerShell user profile

Post 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
User avatar
fr3288
Posts: 23
Last visit: Fri Sep 18, 2020 1:20 pm

Re: PrimalScript PowerShell user profile

Post by fr3288 »

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: 196
Last visit: Mon Mar 25, 2024 11:57 am

Re: PrimalScript PowerShell user profile

Post 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
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: PrimalScript PowerShell user profile

Post 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.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.