Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > How to use PowerShell 7 and PnP.PowerShell When You Can’t Install Software
June 04
How to use PowerShell 7 and PnP.PowerShell When You Can’t Install Software

During the last Ask Sympraxis our friend Kasper Larsen relayed a question he had gotten recently, “Is it possible to run the PnP.PowerShell module if I’m not allowed to install it or PowerShell 7?” The question brought tears of sadness to my eyes. Then, my indomitable spirit kicked in, “We’ll help this person!”, it said. And here we are.

The short answer to, “Can you run PnP.PowerShell if you can’t install anything” is a resounding, “Yes! Heck yes you can!” The answer to “how” comes in two parts. The first is to download the PowerShell 7 Zip file and run pwsh.exe out of there without installing it. The second part is to install the PnP.PowerShell module in the CurrentUser scope, so that it doesn’t try to write anything to a protected directory. After that, run PnP.PowerShell cmdlets to your heart’s content.

Here’s what it looks like:

image

There’s proof, the PowerShell way, that the user I’m logged in as isn’t an admin. First, I download the PowerShell 7 zip file and extract it to a folder in my Downloads folder.

image

Then I CD to the directory and run pwsh.exe, like this:

image

You can see from the $PSVersionTable that we’re running PowerShell 7. Now I install the PnP.PowerShell module to my user with the line Install-Module pnp.powershell –Scope CurrentUser.

image

After I run the install I use Connect-PnPOnline like I normally would. At the bottom I highlighted where the module is installed, your personal Documents directory.

One very important note, is that you (or anyone) won’t be able to connect if the PnP.PowerShell application registration hasn’t been approved in your tenant. This blog post, “How to Register the PnP.PowerShell App Registration if You’re not a Tenant Admin” covers it a bit. That App Registration is necessary in 99% of the use cases. You can connect and do a few SharePoint things without it, but that list is pretty short.

I’m not sure how often this will come up, but hopefully this blog post is at least interesting. Smile

tk

ShortURL: https://www.toddklindt.com/PoshWithoutAdmin

Comments

Do my assignment for me online

Managing coursework alongside other responsibilities can be overwhelming, which is why I turned to 'Do my assignment for me online' services https://essayhub.com/do-my-assignment for help. The support I received was excellent—the assignment was well-structured, thoroughly researched, and delivered on time. It’s clear they prioritize quality and customer satisfaction.
 on 11/20/2024 2:31 AM

great

Basketball enthusiasts and casual players alike have taken to the thrilling online game Basketball Stars. It offers an exhilarating experience that is simple to pick up yet difficult to put down, thanks to its captivating gameplay and colorful graphics. https://slopegame3d.org/

 
 on 11/21/2024 12:51 AM

Lonniekoch

When I am very eager to decipher a mysterious word but can't think of it, right now https://wordlehint.io can solve all difficult problems to help me find the mysterious word quickly.
 on 11/21/2024 8:22 PM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 SysKit