Page 1 of 2

Cmdlet Autocomplete & "In" autocomplete

Posted: Mon Dec 04, 2017 12:43 pm
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"?

Re: Cmdlet Autocomplete & "In" autocomplete

Posted: Mon Dec 04, 2017 1:07 pm
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.

Re: Cmdlet Autocomplete & "In" autocomplete

Posted: Mon Dec 04, 2017 3:07 pm
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.

Re: Cmdlet Autocomplete & "In" autocomplete

Posted: Tue Dec 05, 2017 6:56 am
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.

Re: Cmdlet Autocomplete & "In" autocomplete

Posted: Tue Dec 05, 2017 7:17 am
by mxtrinidad
Thanks for responding.

We are taking a look at it and we'll get back to you soon.

Re: Cmdlet Autocomplete & "In" autocomplete

Posted: Tue Dec 05, 2017 8:27 am
by Alexander Riedel
What version of the Azure module do you have installed?

Re: Cmdlet Autocomplete & "In" autocomplete

Posted: Tue Dec 05, 2017 8:32 am
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?

Re: Cmdlet Autocomplete & "In" autocomplete

Posted: Tue Dec 05, 2017 9:33 am
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;
		}
	}
}

Re: Cmdlet Autocomplete & "In" autocomplete

Posted: Tue Dec 05, 2017 9:39 am
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.

Re: Cmdlet Autocomplete & "In" autocomplete

Posted: Tue Dec 05, 2017 9:42 am
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 6423 times
I do not see any case correction.