Forum Discussion
Get-PnPSite or Get-PnPWeb error File Not Found
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)-admin.sharepoint.com..."
Connect-PnPOnline -Url "https://myCompany-admin.sharepoint.com"
Get-PnPWeb -Identity "https://myCompany.sharepoint.com/sites/mySite"But I'm getting an error saying:
Get-PnPWeb : File Not Found.
At line:4 char:1
+ Get-PnPWeb -Identity "https://myCompany.sharepoint.com/sites/MyCompan...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-PnPWeb], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,PnP.PowerShell.Commands.GetWebI'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.
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.
5 Replies
- Connect-PnPOnline -Url "https://myCompany-admin.sharepoint.com" -Interactive, does that work?
- CardinalNightBrass ContributorHi - yes that works but the error comes from
Get-PnPWeb -Identity "https://myCompany.sharepoint.com/sites/mySite"
I get a "File not Found"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.