Score:0

PowerShell 5.1 I know this UNC path exists and I can get to it from explorer, so why error message

kr flag
Rod

Environment:
PowerShell 5.1
Windows 2016 Standard
Windows 10 Pro

I know this UNC path exists because I can get to it from Window Explorer both in Win 10 and Win 2016, so why am I getting this error?

This works fine on my Windows 10 machine but not on Windows 2016 Standard machine, smh.

COMPUTER01 here is a remote server.

$versionFolder = "\\COMPUTER01\c$\temp"
$sspLatestVer = (Get-ChildItem $versionFolder | Sort-Object LastWriteTime -Descending | Select-Object -First 1).Name

Error message:

Get-ChildItem : Cannot find path '\\COMPUTER01\c$\temp' because it does not exist.
At C:\temp\candidate2.ps1:24 char:18
+ $sspLatestVer = (Get-ChildItem $versionFolder | Sort-Object LastWrite ...
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (\\COMPUTER01\c$\temp:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
Abraham Zinala avatar
cn flag
Is remoting enabled?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.