『起動したスクリプトのパス名を取得する』スクリプトを書いた時に、気が付いたことをメモとして残します。 パス取得処理をサブルーチンに書く場合、"script:"を書き忘れると目的と違う結果になります。 確認用スクリプト function Initialize { Write-Host " === B ...
生成AIが拾ってきたスクリプトを、少しずつ解説してもらいながら勉強を進めます。 → 関数を定義するときに使うキーワードです。処理のまとまりを作るイメージ。 📌 記録 function:関数を定義するためのキーワード myFirstScript → 関数の名前です。好きな ...
As a beginner to writing scripts with PowerShell, you won't learn the concept of a function until later. Newbies typically learn about PowerShell functions after they've learned what the pipeline is, ...
To avoid errors, it's important to write PowerShell scripts that prevent code from running on an unintended platform. Luckily, this is easier to do than it sounds. Up until a few years ago, PowerShell ...