Hello,
more often than not I work with large script files (3k+ lines) so it can happen during maintenance and/or updates to the script that some variables previousely declared are not sued anymore, it would be great if PowerShell Studio would give me a way to highlighty all unused variables and/or functions so that code can be cleaned up.
I know I can setup some pre-flight checks for this but would love to have it directly in the editor.
Thanks in advance for considering this.
Unused variables and/or functions
Forum rules
Do not post any licensing information in this forum.
Do not post any licensing information in this forum.
- PsCustomObject
- Posts: 137
- Last visit: Mon Mar 18, 2024 3:11 am
Re: Unused variables and/or functions
Have you tried the PSScriptAnalayzer module? It performs validates tests on scripts. Once installed, you can trigger it from PowerShell Studio (Tools->Validation->Analyze Script) or automatically when you run a script.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- PsCustomObject
- Posts: 137
- Last visit: Mon Mar 18, 2024 3:11 am
Re: Unused variables and/or functions
Thanks David,
yep I'm aware of the module, even if I will admit never used within PSS which I will remediate soon, what I was referring was something more "real time".
More often than not I don't run scripts from within PSS for a variety of reasons, so having red/green/blue squiggly underlines would be a real time saver for me, what I usually do is copying/pasting code to Visual Studio Code which does this natively.
I can live without the feature as PSS already saves me TONS of time when coding but avoid the extra step would be great addition
yep I'm aware of the module, even if I will admit never used within PSS which I will remediate soon, what I was referring was something more "real time".
More often than not I don't run scripts from within PSS for a variety of reasons, so having red/green/blue squiggly underlines would be a real time saver for me, what I usually do is copying/pasting code to Visual Studio Code which does this natively.
I can live without the feature as PSS already saves me TONS of time when coding but avoid the extra step would be great addition
Re: Unused variables and/or functions
Thank you for the feedback. We will see what we can do.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.