Cmdlet Autocomplete & "In" autocomplete

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 6 years and 2 months 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
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

Cmdlet Autocomplete & "In" autocomplete

Post by clum09 »

Product, version and build: 7.3.108
32 or 64 bit version of product: 64-Bit
Operating system: Windows 10
32 or 64 bit OS: 64-Bit

Hello,

I have been unable to to have PrimalScript's PrimalSense to autocomplete the Azure Active Directory cmdlets in the Editor like it does on the PowerShell ISE.
Is there anyway I can have PrimalSense autocomplete the Azure Active Directory cmdlets?

Some of the cmdlets used for Azure Active Directory is Connect-MsolService, Set-MsolUserLicense, etc.

One annoying thing I found in PrimalScript editor is any time I try to write a for...loop command in the Editor, it tries to upper case the "i" letter of the word in to "I", such as in foreach ($i in $list) {$i}. Instead if leaving the "in" keyword as it is, it tries to upper case the "i" of the word "in" to "In" instead.

Is there any way to remove the autocomplete of the keyword "in" so that the "i" letter stays as I type it without upper casing the letter "I"?
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Cmdlet Autocomplete & "In" autocomplete

Post by mxtrinidad »

In PrimalScript, look under "File" menu, click on "Options" then under "Text Editor" in "PrimalSense | PrimalSense Option" unchecked the "Auto case correction". This should stop the behavior you're experiencing.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cmdlet Autocomplete & "In" autocomplete

Post by Alexander Riedel »

Bring up the cache editor in the ribbon and make sure your Azure module is selected for the platform and powershell version you are using.
Please also make sure that you have that same platform and PowerShell version selected in PrimalScript's ribbon.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

Re: Cmdlet Autocomplete & "In" autocomplete

Post by clum09 »

When I unchecked the "Auto case correction" in "Text Editor" in "PrimalSense | PrimalSense Option" dialog, it stopped the auto casing for the "in" keyword, and it also stopped to autocomplete and auto case for the functions that I had within the script.

For the Autosense of the Azure modules, I added all the Azure modules for the proper platform and PowerShell version in cache editor and clicked on "Build Cache" button, but the autosense still does not work even after restarting PrimalScript.
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Cmdlet Autocomplete & "In" autocomplete

Post by mxtrinidad »

Thanks for responding.

We are taking a look at it and we'll get back to you soon.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cmdlet Autocomplete & "In" autocomplete

Post by Alexander Riedel »

What version of the Azure module do you have installed?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cmdlet Autocomplete & "In" autocomplete

Post by Alexander Riedel »

I fired up PrimalScript with default settings and typed foreach ($i in $list) {$i} in a PowerShell Script.
The 'in' did not case correct to 'In'
Do you have a variable called '$In' in your script or a function 'In' or a '-In' parameter?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

Re: Cmdlet Autocomplete & "In" autocomplete

Post by clum09 »

The Azure for Active Directory version is 1.1.166.0.

For the in casing, you can try copy the following for loop script onto a blank page of the PrimalScript's Editor.

As soon as you change In to in on the first line, PrimalScript will upper case the i in front of in to In.

Code: Select all

foreach ($objUser In $unlicensedUserList)
{
	if ($groupUserList.ContainsKey($objUser.UserPrincipalName))
	{
		$userPrincipalName = $objUser.UserPrincipalName;
		$displayName = $groupUserList.Item($userPrincipalName);
		$msg = "Activating license for $displayName. . .";
		try {
			Set-MsolUserLicense -UserPrincipalName $userPrincipalName -AddLicenses "domain:ENTERPRISEPACK";
			$msg = "Activation completed successfully.";
			$object = '' | Select-Object 'User Name','Activated',Message;
			$object.'User Name' = $displayName;
			$object.'Activated' = $true;
			$object.Message = $msg;
			$activatedUserList += $object;
		}
		catch
		{
			$msg = $_.Exception.Message;
			$object = '' | Select-Object 'User Name','Activated',Message;
			$object.'User Name' = $displayName;
			$object.'Activated' = $false;
			$object.Message = $msg;
			$unActivatedUserList += $object;
		}
	}
}
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cmdlet Autocomplete & "In" autocomplete

Post by Alexander Riedel »

This is a mix of two issues here, which makes this a little bit cumbersome. In the future please create a thread for one issue.
I will investigate both and see what I can find out.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Cmdlet Autocomplete & "In" autocomplete

Post by Alexander Riedel »

I paste your code in a new windows and correct to 'In' to 'in'
2017-12-05_9-41-09.png
2017-12-05_9-41-09.png (129.39 KiB) Viewed 6437 times
I do not see any case correction.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 6 years and 2 months 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.