I run a simple Get-Item cmdlet to get the below result :
(Get-Item -Path \\priam\coste\ZEDMB5T-Intransit-report\* -Include DAILYREPORT_TES_MSS_20190426_*.XLS).name
I try the same using an invoke-command, but it does not give me anything :
invoke-command -ScriptBlock {(Get-Item -Path \\priam\coste\ZEDMB5T-Intransit-report\* -Include DAILYREPORT_TES_MSS_20190426_*.XLS).name} -computername localhost -Credential Get-Credential
There is nothing wrong with the credentials since it does work for the below command :
invoke-command -ScriptBlock {"testing"} -computername localhost -Credential Get-Credential
I have access to the path as well :
Get-Acl -Path \\priam\coste\ZEDMB5T-Intransit-report | Format-List -Property *
I am running the powershell ISE as an administrator, as seen in the title bar :
I am using a recent version of PS :
What am i doing wrong here?