Skip to content

Error: Invoke-Expression : Cannot bind argument to parameter 'Path' because it is null. #23

@krot4u

Description

@krot4u

Hi!
When I run action and when the Run Amadevus/pwsh-script@v2 executes - there is an Error

Error: Invoke-Expression : Cannot bind argument to parameter 'Path' because it is null.
At /home/runner/work/_actions/Amadevus/pwsh-script/v2/action.ps1:21 char:23
$Private:result = Invoke-Expression $Private:scriptFile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : InvalidData: (:) [Invoke-Expression], ParameterBindingValidationException
FullyQualifiedErrorId : >ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.InvokeExpressionCommand

Error: Process completed with exit code 1.

Here is the Action yaml:
`
name: Convert Contact List
on:
workflow_dispatch:
schedule:
- cron: "* */3 * * *"

jobs:
build:
name: Run Script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

  - uses: Amadevus/pwsh-script@v2
    id: script
    env:
      GH_TOKEN: ${{ github.token }}
    with:
      script: |
        # ------ AnyTone ------ #
        $DMRIdsContent = Get-Content ./DMRIds.dat

  - name: Update files in repository
    uses: actions-x/commit@v6
    with:
      email: "krot4u@gmail.com"
      name: GitHub Actions Autocommitter
      branch: master
      files: Devices_Contact_List/*
      repository: https://github.com/${{ github.repository }}
      token: ${{ github.token }}
      force: true

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions