Prerequisites
Steps to reproduce
create an assembly and run a script with the following content:
using assembly mydll.dll
[mydll.mytype]
Expected behavior
Actual behavior
ParserError: /Users/james/bin/testit.ps1:1
Line |
1 | using assembly mydll.dll
| ~~~~~~~~~~~~~~~~~~
| Cannot load assembly 'mydll.dll'.
Error details
line 5136:
assemblyFileName = workingDirectory + @"\" + assemblyFileName
on a Unix System, \ is not a directory separator but a valid filename character.
The fix is:
assemblyFileName = Path.Combine(workingDirectory, assemblyFileName);
Environment data
> $psversiontable
Name Value
---- -----
PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Darwin 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:28:58 PST 2023; root:xnu-10002.81.5~7/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
create an assembly and run a script with the following content:
using assembly mydll.dll [mydll.mytype]Expected behavior
no errorsActual behavior
Error details
line 5136:
assemblyFileName = workingDirectory + @"\" + assemblyFileNameon a Unix System,
\is not a directory separator but a valid filename character.The fix is:
assemblyFileName = Path.Combine(workingDirectory, assemblyFileName);Environment data
Visuals
No response