# スクリプト自身のパスを取得
$psPath = (Split-Path $MyInvocation.MyCommand.Path -Parent)
# ログファイルのパス
$logPath = "$psPath\$($(Get-Item $MyInvocation.MyCommand.Path).BaseName).log"
# ログファイルへの書き込み
##Set-Content -Path $logPath -Value ""
# 新しいPSバージョンの場合は下記でOK
$PSScriptRoot