You are here: PSPad forum > English discussion forum > Re: Powershell typing and PSPad labels, preprocessors

Re: Powershell typing and PSPad labels, preprocessors

#1 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.Collectionsare 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.

Options: Reply | Quote | Up ^


#2 Re: Powershell typing and PSPad labels, preprocessors

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.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2020 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR