0%

0/1 Lessons

Course Introduction

• 5min

0 / 2 lessons complete

Getting Started with Windows PowerShell

• 56min

0 / 8 lessons complete

Getting Help and Finding Commands

• 39min

0 / 6 lessons complete

PowerShell Command Syntax

• 33min

0 / 5 lessons complete

PowerShell Objects and Properties

• 35min

0 / 6 lessons complete

The PowerShell Pipeline

• 24min

0 / 2 lessons complete

PowerShell Providers

• 30min

0 / 5 lessons complete

PowerShell Arrays and Variables

• 28min

0 / 4 lessons complete

PowerShell Loops

• 19min

0 / 3 lessons complete

PowerShell Conditional Statements

• 11min

0 / 1 lessons complete

On Premises Lab Setup

• 36min

0 / 8 lessons complete

Basic Domain Administration with Windows PowerShell

• 2hr 27min

0 / 10 lessons complete

Send Emails with PowerShell

• 22min

0 / 2 lessons complete

PowerShell Desired State Configuration (DSC) Basics

• 1hr 48min

0 / 6 lessons complete

PowerShell Modules

• 58min

0 / 7 lessons complete

Powershell Challenges

• 1hr 55min

0 / 23 lessons complete

Course Conclusion

• 1min

0 / 1 lessons complete

PowerShell Provider CMDlets -1

Instructions

Q&A (0)

Notes (0)

Resources (0)

Saving Progress...

Resources

There are no resources for this lesson.

Notes can be saved and accessed anywhere in the course. They also double as bookmarks so you can quickly review important lesson material.

Create note

In this lecture we will take a look at several different cmdlets that are designed for use with Powershell Providers.

If you would like a complete list of provider cmdlets and links for further information, check the following link: PowerShell Provider cmdlets

Location Cmdlets – These cmdlets are used for directory navigation. The cd (change directory) command can be used to navigate between directories. But, as the number of directories that we need to track grows, this approach becomes more and more inefficient, as most of these paths are usually too long to type. And that’s why location cmdlets can be extremely useful.

Get-Location – (alias GL) This cmdlet gets an object that represents the current directory.
      Sets the working location to a specified location

   Set-Location – (alias is SL) Sets the working location to a specified location. That location could be a directory, a subdirectory, a registry location, or any provider path.

      Push-Location – (alias is pushd) Adds ("pushes") the current location onto a location stack.

      Pop-Location – (alias is popd) Changes the current location to the location most recently pushed onto the stack by using the Push-Location cmdlet.

What is a stack? Think of a stack like a stack of books.

Graphical user interface  Description automatically generated

1984

Guliver’s Travels

Hamlet

Moby Dick

I add books by adding them to the top of the stack. If I want to remove a book, let’s say Guliver’s Travels, normally I would remove the first book, then remove the second book. In computer terms this is referred to “Last in, first out” or (LIFO)
So my book stack has two methods, add and remove. So, in computer terms a stack has two methods push and pop. An item is pushed to the stack (added) or popped off (removed) from the stack.

I can demonstrate this by creating 4 folders.

Let’s say that we need to work with these four folders.

Table  Description automatically generated with medium confidence

From your C: drive create a folder called books, then create the four sub-folders. Stop the video while you do this.

Graphical user interface  Description automatically generated

Now lets add all four folders to the stack by using our pushd alias cmdlet

Type pushd c:\books\1984 (pressh return)

Type pushd c:\books\gulivers_travels

Type pushd c:\books\hamlet

Type pushd c:\books\moby_dick

Graphical user interface  Description automatically generated with low confidence

Now let’s view the stack by using the get-location -stack (parameter)
remember (LIFO) last in first out

Type get-location -stack (press return)

Because get-location displays our current location, moby_dick is in the stack but not shown in the stack.

Now from PS C:\books\moby_dick location type popd 

Type get-location -stack (moby_dick) has been removed from the stack)

From PS C:\books\Hamlet location type popd

Type get-location -stack now hamlet has been removed from the stack

From PS C:\books\Gulivers_Travels location type popd 

Type get-location -stack (gulivers travels has been removed from the stack)

From PS C:\books\1984 location type popd

Type get-location -stack (1984 has been removed from the stack)

Type get-location -stack and now the stack is empty.

As you can see we can move between these four folders and easily remove the folders from the stack that are no longer needed.

Set-Location

You can use this cmdlet to access PowerShell drives. This cmdlet changes the current location to a new location. The location could be a registry location, folder or subfolder. To understand how this works type: 

Server Academy Members Only

Sorry, this lesson is only available to Server Academy Full Access members. Become a Full-Access Member now and you’ll get instant access to all of our courses.

0 0 votes
Lesson Rating
Subscribe
Notify of
profile avatar
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

profile avatar
CJ22(@chrisc5)
Member
7 months ago

Is there a download that should be included here?