I'm attempting to find a users downloads directory in powershell using this line:
$downloadDirectory = "$env:USERPROFILE\Downloads"
But I'm getting the following error:
Get-ChildItem : Cannot find path 'C:\Users\skewb\Downloads' because it does not exist.
At D:\Users\Skewb\Documents\repos\DotaMatchFinder\unzip_move_run.ps1:16 char:5
+ Get-ChildItem -Path $downloadDirectory
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\skewb\Downloads:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
When I type the following into the file explorer %USERPROFILE%/Downloads
I'm taken to the correct path D:\Users\Skewb\Downloads
Is this intended? Do I need to find this directory another way?