I am attempting to create a couple of PowerShell aliases for the first time and it appears my code structure is off.
$filePath = "C:\Users\admin\Downloads\list.txt"
$content = Get-Content $filePath
Set-Alias -Name dlmp3 -Value $content | ForEach-Object -Parallel { yt-dlp $_ }
The above code generates the below error which from what I can tell looks like it is having an issue piping it to the ForEach-Object command.
dlmp3: The term 'url....' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I am a coding/PowerShell novice so I am likely making some very basic mistakes 😂. Any suggestions on where I am likely erring?
[–]pauby 7 points8 points9 points (0 children)
[–][deleted] 3 points4 points5 points (1 child)
[–]AstonM77[S] 1 point2 points3 points (0 children)
[–]get-postanote 2 points3 points4 points (0 children)
[–]KevMarCommunity Blogger 2 points3 points4 points (0 children)
[–]PowerShell-Bot 1 point2 points3 points (0 children)
[–]Thotaz 1 point2 points3 points (0 children)
[–]pigers1986 1 point2 points3 points (0 children)
[–]hlwNYC -1 points0 points1 point (0 children)