Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

"using assembly" can't find assembly in scriptdir on non-Windows because of bug in Parser.cs line:5136 #21161

Copy link
Copy link
@JamesWTruher

Description

@JamesWTruher
Issue body actions

Prerequisites

Steps to reproduce

create an assembly and run a script with the following content:

using assembly mydll.dll
[mydll.mytype]

Expected behavior

no errors

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

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.