Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
別のコンピューターから実行可能なスクリプトがあります。
ロケーションスクリプトのコンピュータ名を取得するには? フルパスではなく名前だけです(スクリプトはどこにでも配布できるため)ありがとう
自力で解決。:-) 誰かを助けることを願っています。
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition [string[]]$sth = $scriptPath.Split('\',[System.StringSplitOptions]::RemoveEmptyEntries) $servername = $sth[0]