まず読む記事
- PowerShell「null 配列内にインデックス アクセスすることはできません」Select-String の Matches.Groups[1] で出る原因と直し方
- robocopy のログを Get-Content で読むと「���v �R�s�[�ς�」と文字化けする。Shift_JIS(932)を指定して読む
- Git Bash から pwsh -Command に `$_ を渡すと「unexpected EOF while looking for matching “’」。.ps1 に書いて -File で通った
症状・手順から探す
- Git Bash から pwsh -Command に `$_ を渡すと「unexpected EOF while looking for matching “’」。.ps1 に書いて -File で通った
- PowerShell の -notmatch ‘\__pycache__\’ で「Invalid pattern … Unrecognized escape sequence \_」。-notlike で直す
- PowerShell の Parser::ParseFile で「[ref] は、存在しない変数には適用できません」。先に $null を入れておけば通る
- PowerShell の -match ‘(?m)^KEY\s*=\s*250\s*$’ が設定ファイルの値を見落とす。原因は行末のコメント(#)
- robocopy のログを Get-Content で読むと「���v �R�s�[�ς�」と文字化けする。Shift_JIS(932)を指定して読む
- PowerShell「null 配列内にインデックス アクセスすることはできません」Select-String の Matches.Groups[1] で出る原因と直し方