ファイル・フォルダの存在確認の方法は以下。

if(Test-Path [パス]){

<存在した場合の処理>

}

参考サイトは以下

https://bayashita.com/p/entry/show/54

Follow me!