Closed dotChris90 closed 6 years ago
Hi there @dotChris90,
That's actually https://github.com/PowerShell/PSScriptAnalyzer that's doing the underlining not the syntax. The issue is that the using
statements in PowerShell cannot have anything other than comments between them and the beginning of the file.
The using statement needs to be the first statement in the script. - About_Using
You need to move the Add-Type
line below the using
statements. As it stands they're invalid and being ignored.
@omniomi
thanks for that. it works. I did not know Powershell was truely able to using a Namespace before the DLL was loaded into the scope of it. ;)
Thanks you a lot. Wish you a nice Weekend.
I think you need just replace add-type
by using assembly
to bring it into the session.
thanks for advice but the Add-Type works fine. Just the red lines was weird to me because I though powershell just can using namespaces of imported DLLs but .... nope. You can put the add-type at the end and all is fine. ^^
Environment
Issue Description
Screenshots
Expected Behavior
do not Show error