在我的Github project中,我的powershell script中有以下代码片段
param (
[string]$f,
[string]$l
)The Super-linter给我看this error
SC1036: '(' is invalid here. Did you forget to escape it?但是代码本身是有效的。我还尝试禁用这个linter规则,但不幸的是,这不起作用。
发布于 2020-10-08 07:49:14
PowerShell脚本不应该有#!/bin/bash解释器行(shebang)。这行解释器可能会混淆linter,使其运行shellcheck (用于bash/sh脚本),而不是PSScriptAnalyzer ( powershell linter)。
在Linux/Mac上,PowerShell的正确解释行是#!/usr/bin/env pwsh。1
https://stackoverflow.com/questions/64234725
复制相似问题