Get-PnPSite or Get-PnPWeb error File Not Found

Copper Contributor

I am using this version of PS:
Major Minor Build Revision
-----    -----   -----   --------
5           1      19041    3570

I have also installed PnP for PowerShell.

I am attempting this:

$tenant = "myCompany"
Write-Host "Connecting to https://$($tenant)"
Connect-PnPOnline -Url ""
Get-PnPWeb -Identity ""

But I'm getting an error saying:

Get-PnPWeb : File Not Found.
At line:4 char:1
+ Get-PnPWeb -Identity "
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-PnPWeb], PSInvalidOperationException
    + FullyQualifiedErrorId : InvalidOperation,PnP.PowerShell.Commands.GetWeb

I've read ALL existing MS documentation and even the PnP docs, but nothing shows how to do it.
My objective is to connect to the tenant (this works) then get a specific site so I can start adding items to it.

5 Replies
Connect-PnPOnline -Url "" -Interactive, does that work?
Hi - yes that works but the error comes from
Get-PnPWeb -Identity ""
I get a "File not Found"
Yes, I understand. (Not a SharePoint expert) But you seem to have to connect to the specific site first to use Get-PnPWeb, and I tested that myself. That works. In your case, you should use:
Connect-PnPOnline -Url ""
best response confirmed by CardinalNight (Copper Contributor)

@CardinalNight Did that work out for you?

Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.

If one of the posts was helpful in other ways, please consider giving it a Like.

This was the answer:
Connect-PnPOnline -Url ""