Introduction

Welcome to this walkthrough on PowerShell fundamentals in this exercise, we will cover the basics of PowerShell, including navigation, file and folder management, gathering information, and scripting. By the end of this walkthrough, you will have a solid understanding of how to use PowerShell to perform common administrative tasks and will be able to apply this knowledge to real-world scenarios.

In this walkthrough, we will start by exploring the PowerShell interface and learning how to navigate and manage files and folders. We will then move on to gathering information about the system, including CPU, memory, and disk information. Finally, we will learn how to use PowerShell scripting to automate tasks and solve administrative problems.

Throughout this walkthrough, we will use a combination of cmdlets, scripts, and exercises to help you learn and practice your skills. By the end of this walkthrough, you will be able to use PowerShell to perform a variety of tasks, including:

  • Navigating and managing files and folders
  • Gathering information about the system
  • Using PowerShell scripting to automate tasks
  • Solving administrative problems using PowerShell

Let's get started.

Lab Questions and Answers: 1.1 Core Concepts

1. PowerShell is best described as:

A. A Windows-specific wrapper for BASH.

B. A blend of Windows CLI, VBScript, and Windows Management Instrumentation.

C. An object-oriented scripting language for automation, server management, documentation, and information administration.

D. A Python-based administration toolkit for Windows servers.

Answer: C

2. Cmdlet syntax is composed of two words: a ___ followed by a ____.

Answer: Verb, Noun

3. Piping is best described as:

A. Using one cmdlet’s output as another’s input.

B. Not needing to declare a variable’s data type.

C. An action you can perform on an object.

D. A type of loop.

Answer: A

Lab Questions and Answers: 1.2 Guided Exercise

1. How many PowerShell cmdlets are available on the lab server at the start of the exercise?

A. Less than 6000

B. Over 9000

C. Over 13000

D. Over 15000

E. Under 12000

Answer: C

2. What are the two aliases for the Get-Location cmdlet?

Answer: gl, pwd

3. What is the OSVersion of the lab server?

Answer: 10.0.17763

4. Which Users are enabled by the LearningPowerShell.ps1 script?

Answer: Administrator, cybrary, cybraryadmin

Lab Questions and Answers: 1.3 Challenge Exercise

1. How many text files are located in C:\Users\cybrary\Desktop\Happy?

Answer: 2000


2. What does the script group.ps1 in C:\Users\cybrary\Documents do?
(select all that apply)
A. Creates two local users.
B. Lists two local users.
C. Creates two local groups.
D. Lists two local groups.
E. Puts users into the correct group.
F. Puts users into the wrong group.

Answer: A, C, F
3. Which user should be added to group Woof?

Answer: Fido

4. Which user should be added to group Meow?

Answer: Mittens

Conclusion

In this article, we explored the basics of PowerShell and learned how to use it to perform common administrative tasks. We gained hands-on experience with navigating and managing files and folders, gathering system information, and using scripting to automate tasks. Through this exercise, we demonstrated the power and flexibility of PowerShell as a tool for system administration. By mastering PowerShell, administrators can streamline their workflows, automate tasks, and improve productivity, making it an essential skill for anyone working in IT.