You are here: PSPad forum > English discussion forum > Powershell typing and PSPad labels, preprocessors
Posted by: clanman | Date: 2020-05-14 07:56 | IP: IP Logged
Recently I have found myself doing more and more powershell scripting. Some of the things PSPad seems not to be able to recognise are:
1. Variables which start with $
2. Strongly typed variables named like [array]$var
3. Function attributes and arguments
With 3, these are as follows
Attributes - inside square brackets separated by commas eg: [Parameter(Mandatory = $False, HelpMessage="Enter one or more computer names separated by commas.")]
So [Parameter] is the attribute and Mandatory and HelpMessage are arguments.
The thing is there is no definitive list of strongly typed variables as these change when statements such asusing namespace System.Collections
are used which adds additional types
I thought maybe preprocessors might be the answer to recognise these (see
forum.pspad.com) however there seems to have been no movement on this.
I know labels are defined as a line starting with a colon : so I doubt that can be used?
So far I have started using [KeyWords3] but as mentioned above it is not ideal.
See docs.microsoft.com for a list of function parameters and arguments.
I am wondering if labels/preprocessors can be used to recognise these things or perhaps someone else already has a solution.
Posted by: pspad | Date: 2020-05-14 08:25 | IP: IP Logged
hello
Can you send me to support mail your current PowerShell definition and some sample source?
Variables, starting $ can be recognized using current 5.0.4 buold and checking [x]PHP style variables option
Labels are implemented, check [x]Label option
The rest can be done, but there is necessary to modify general highlighter.
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR