Shell.Application의 powershell 문자열 보간

Shell.Application의 powershell 문자열 보간

PowerShell 스크립트가 있습니다.

$filex = Get-ChildItem C:\somewhere\anotherfolder\anotherfolder\lastfolder\ -recurse -Filter *coolfile.exe
$ShellExp = New-Object -ComObject Shell.Application
$ShellExp.open("{$filex} http://speedtest.tele2.net/10MB.zip %appdata%\101x.zip")

$filex를 실행하려면 어떻게 해야 합니까?

답변1

나는 당신이 다음과 같은 질문을 하고 있다고 믿습니다.https://stackoverflow.com/q/44035920/7537973 어떤 경우에는 대답은 다음과 같습니다.https://stackoverflow.com/a/44036090/7537973

Tl;dr은 함수를 $() 안에 넣습니다. 예에서는 다음과 같습니다.$ShellExp.open("$(Get-ChildItem C:\somewhere\anotherfolder\anotherfolder\lastfolder\ -recurse -Filter *coolfile.exe) http://speedtest.tele2.net/10MB.zip %appdata%\101x.zip")

관련 정보