我可以使用 powershell 從資源管理器視窗取得選定的檔案嗎?

我可以使用 powershell 從資源管理器視窗取得選定的檔案嗎?

在 Applescript 中,在 Finder 視窗中取得選定的檔案非常容易。

tell application "Finder"
  set finderSelList to selection as alias list
end tell

Powershell 中有等效的嗎?

我想要做的是在資源管理器視窗中任意選擇檔案作為檔案物件陣列。所以

get-explorer-selection|%{do-something-to $_}

其中get-explorer-selection傳回最前面的資源管理器視窗中所選檔案的陣列

相關內容