Last active
September 13, 2021 19:55
-
-
Save gregmac/f70e3ae3d878c5d9f94f4e3c5d94113c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Create a Start Menu shortcut for the settings for each camera on the system. | |
Requires ffmpeg installed via https://scoop.sh/ | |
(or modify to point at the proper ffmpeg.exe location) | |
#> | |
$ffmpeg = "`$env:USERPROFILE\scoop\apps\ffmpeg\current\bin\ffmpeg.exe" | |
Get-PnpDevice -Class Camera | foreach { | |
Write-Host "Creating shortcut for $($_.FriendlyName)" | |
$command = "start-Process -filePath $ffmpeg -ArgumentList @('-f dshow -show_video_device_dialog true -i video=`"`"`"$($_.FriendlyName)`"`"`"') -NoNewWindow" | |
$Shortcut = (New-Object -comObject WScript.Shell).CreateShortcut("$env:AppData\Microsoft\Windows\Start Menu\Programs\$($_.FriendlyName) Settings.lnk") | |
$Shortcut.TargetPath = "powershell.exe" | |
$Shortcut.Arguments = "-windowstyle hidden -command `"$($command -replace "`"","`"`"`"")`"" | |
$Shortcut.Save() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment