To help you better we need some information from you.
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product: PowerShell Studio 2022 (64 Bit)
Build: v5.8.208
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.19044.0
*** Please add details and screenshots as needed below. ***
DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
I apologize if this is in the wrong forum but it appears it's only related to PowerShell Studio.
When I paste https://github.com/jaapbrasser/SharedSc ... rogram.ps1 into a ps1 or PSF within PSS, I get this error. I've used this code on and off since it's inception but never a need within your application. I just tested this within ISE, VSCode, and Powershell cmd line.
Any thoughts?
Function not working within app
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: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Function not working within app
This looks like an error from the syntax check, which, albeit done via PowerShell, may deliver a different result than actually running the code.
Does the code run from within PowerShell Studio or not?
Does the code run from within PowerShell Studio or not?
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Function not working within app
Thanks for the reply. It does not, this is what displays in the Output tab
Test10.12.2022.psf (129, 11): ERROR: At Line: 129 char: 11
ERROR: + [int]# This parameter only works when Exclude ...
ERROR: + ~
ERROR: Parameter declarations are a comma-separated list of variable names with optional initializer expressions.
ERROR:
Test10.12.2022.psf (129, 11): ERROR: At Line: 129 char: 11
ERROR: + [int]# This parameter only works when Exclude ...
ERROR: + ~
ERROR: Missing ')' in function parameter list.
ERROR: + CategoryInfo : ParserError: (:) [], ParseException
ERROR: + FullyQualifiedErrorId : InvalidFunctionParameter
ERROR:
Test10.12.2022.psf (129, 11): ERROR: At Line: 129 char: 11
ERROR: + [int]# This parameter only works when Exclude ...
ERROR: + ~
ERROR: Parameter declarations are a comma-separated list of variable names with optional initializer expressions.
ERROR:
Test10.12.2022.psf (129, 11): ERROR: At Line: 129 char: 11
ERROR: + [int]# This parameter only works when Exclude ...
ERROR: + ~
ERROR: Missing ')' in function parameter list.
ERROR: + CategoryInfo : ParserError: (:) [], ParseException
ERROR: + FullyQualifiedErrorId : InvalidFunctionParameter
ERROR:
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Function not working within app
Which PowerShell version exactly are you running this with?
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Function not working within app
I see the problem. The PowerShell Studio automatic formatter creates an error by pulling the variable name up in the comment.
I will get the development team to look at that as soon as possible.
I will get the development team to look at that as soon as possible.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Function not working within app
Thanks so much, I appreciate your quick response.
PSVersion 5.1.19041.1682
PSVersion 5.1.19041.1682
Re: Function not working within app
Please try service build 5.8.212 and let us know if this is still an issue for you.
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.