Product, version and build: 7.4.110_020518
32 or 64 bit version of product: 64-bit
Operating system: Windows 10 Enterprise
32 or 64 bit OS: 64-bit
Hello, I posted a message a while back to request for a fix to the Upper casing of the in to In within the for...loop in PrimalScript Script editor.
The last response I got back from the support technician was it would be fixed in the next build release. I just installed the latest version of PrimalScript on my computer and test the keyword in within for...loop, and the in will become In as soon as I move the cursor away from the n character after the i character.
I simply launched a blank page PrimalScript editor screen I try to type foreach ($obj in $test) { $obj }, and the in within the for loop is upper cased to In.
I have attached screen shot with this post. Please fix this annoying casing issue so that it will stop doing that.
Somehow PrimalScript still senses the in keyword as a parameter input See the attached screen shot.
Uppercase in to In within for..loop
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.
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.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Uppercase in to In within for..loop
PrimalScript recognizes the 'In' keyword as a function because it is defined as such in Pester
[Command]
Function|In|
A convenience function that executes a script from a specified path.
[Syntax]
__AllParameterSets|In [[-path] <Object>] [[-execute] <scriptblock>]
[Parameters]
path|System.Object|
execute|System.Management.Automation.ScriptBlock|
Removing Pester from your module cache via the Cache Editor will resolve the problem.
Unfortunately we cannot force anyone to NOT use PowerShell keywords as functions names, which you should never do.
We'll investigate if we can block functions that use keywords altogether.
[Command]
Function|In|
A convenience function that executes a script from a specified path.
[Syntax]
__AllParameterSets|In [[-path] <Object>] [[-execute] <scriptblock>]
[Parameters]
path|System.Object|
execute|System.Management.Automation.ScriptBlock|
Removing Pester from your module cache via the Cache Editor will resolve the problem.
Unfortunately we cannot force anyone to NOT use PowerShell keywords as functions names, which you should never do.
We'll investigate if we can block functions that use keywords altogether.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Uppercase in to In within for..loop
How can I remove Pester from the module cache? Can you show me how?
Re: Uppercase in to In within for..loop
This video will show you how to add and remove modules using the Cache Editor:
https://www.sapien.com/blog/2018/01/02/ ... he-editor/
The video shows PowerShell Studio but also applies to PrimalScript.
https://www.sapien.com/blog/2018/01/02/ ... he-editor/
The video shows PowerShell Studio but also applies to PrimalScript.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Uppercase in to In within for..loop
I removed Pester from the module cache and rebuilt the cache, but it does not have any effect on the upper casing problem. The "in" will become "In" as I move the cursor away from the n character in the for..loop.
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: Uppercase in to In within for..loop
Remember, remove Pester from both 64 and 32 cache: "PowerShell64v5" and "Powershell32v5", then execute the "Build Cache" . Finally, restart PrimalScript.
The behavior should be corrected.
The behavior should be corrected.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Uppercase in to In within for..loop
The next service build will specifically prevent PrimalSense and case correction on *ALL* PowerShell reserved words as listed here: https://docs.microsoft.com/en-us/powers ... wershell-6
I am quite certain some folks will complain, but our position is that you should never use reserved words as identifiers in your code. Any other programming language would indeed flag something like that as a syntax error.
I am quite certain some folks will complain, but our position is that you should never use reserved words as identifiers in your code. Any other programming language would indeed flag something like that as a syntax error.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Uppercase in to In within for..loop
I removed Pester for both 64-bit and 32-bit from the Cache Editor, rebuilt cache and restarted PrimalScript, but it is still no effect on the casing - the "in" within the for..loop will become "In" after the cursor is moved away from the n character after the i character.
PrimalScript editor decides to sense "in" as a real function or a parameter of a cmdlet within the script, and it mistakenly autocompletes "in" as "In" within the script.
PrimalScript editor decides to sense "in" as a real function or a parameter of a cmdlet within the script, and it mistakenly autocompletes "in" as "In" within the script.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: Uppercase in to In within for..loop
If you uncheck Pester within the Cache Editor and click "Build Cache" in the Cache Editor the cache will be saved with the selected modules, in your case without Pester.
If you then refresh the cache you are undoing your change and rebuilding it with what is on your system.
So using the Cache Editor has the desired effect, you are just undoing it by then again rebuilding the cache.
Cache Editor = Include and Exclude the modules precisely as you want
Rebuild cache = Include all modules found on your system in the cache
If you then refresh the cache you are undoing your change and rebuilding it with what is on your system.
So using the Cache Editor has the desired effect, you are just undoing it by then again rebuilding the cache.
Cache Editor = Include and Exclude the modules precisely as you want
Rebuild cache = Include all modules found on your system in the cache
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.