Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Automate administrative tasks by using PowerShell Microsoft Quiz Answers

Get Automate administrative tasks by using PowerShell Microsoft Quiz Answers

PowerShell can be used to automate tasks such as user management, CI/CD, managing cloud resources and much more. You’ll learn to run commands, how to learn more about PowerShell and additionally to create and run script files.

Prerequisites:

  • Basic familiarity with using a command-line shell like Command Prompt or Git Bash
  • Visual Studio Code installed
  • Ability to install Visual Studio Code extensions
  • Ability to install software on your computer, if you’re not using a Windows operating system

Enroll on Microsoft

Module 1: Introduction to PowerShell

Learn about the basics of PowerShell. This cross-platform command-line shell and scripting language is built for task automation and configuration management. You’ll learn basics like what PowerShell is, what it’s used for, and how to use it.

Learning objectives:

After completing this module, you’ll be able to:

  • Understand what PowerShell is and what you can use it for.
  • Use commands to automate tasks.

Prerequisites:

  • Basic familiarity with using a command-line shell like Command Prompt or Git Bash
  • Visual Studio Code installed
  • Ability to install Visual Studio Code extensions
  • Ability to install software on your computer, if you’re not using a Windows operating system

This module is part of these learning paths:

Quiz 1: Knowledge check

Q1. What’s a correct way to locate a command in PowerShell?

  • Call Get-Command 'name of command'
  • Call Find 'name of command'
  • Call Locate 'name of command'

Q2. How would you search for commands that deal with files?

  • Call Get-Command -Verb File*
  • Call Get-Command -Noun File
  • Call Get-Command -Noun File*

Module 2: Discover commands in PowerShell

PowerShell comes with a built-in help system. Use help to read more about a command, what the command does, and how to call it. Also, if you inspect what a command returns, you can use that information to customize the output, determine what commands are logically grouped, and determine how to use the commands together.

Learning objectives:

When you finish this module, you’ll be able to:

  • Inspect commands to understand how to call them.
  • Understand what a command returns and customize what it returns.

Prerequisites:

  • Be able to start a terminal.
  • Understand what PowerShell is.
  • Know how to run a command in PowerShell.

This module is part of these learning paths:

Quiz 1: Knowledge check

Q1. Using the help system, what command or function helps you paginate the response?

  • 'command' -help
  • Get-Help 'command'
  • help 'command'

Q2. Which statement will most efficiently find the returned type from a command?

  • 'command' -type
  • 'command' | Get-Member
  • 'command' | Get-Type
  • 'command' Get-Member

Module 3: Connect commands into a pipeline

In this module, you’ll learn how to connect commands into a pipeline. You’ll also learn about filtering leftformatting right, and other important principles.

Learning objectives:

After you complete this module, you’ll be able to:

  • Explore cmdlets further and construct a sequence of them in a pipeline.
  • Apply sound principles to your commands by using filtering and formatting.

Prerequisites:

  • Basic familiarity with using command-line shells, such as a Command Prompt window or Git Bash
  • Visual Studio Code, installed
  • Familiarity with installing Visual Studio Code extensions
  • Familiarity with installing software on Windows or other operating systems
  • Familiarity with running commands in PowerShell

This module is part of these learning paths:

Quiz 1: Knowledge check

Q1. How would you find all members of a response starting with “F”?

  • Get-Process 'name of process' | Get-Member -Name F*
  • Get-Process 'name of process' | Get-Member -Name F
  • Get-Process 'name of process' | Get-Members -Name F*

Q2. What will this command answer with Get-Process 'some process' | Format-Table Name, CPU | Select-Object Name, CPU“?

  • The Name and CPU for the process in question.
  • Empty response
  • It will throw an error

Q3. Which statement is the best choice for filtering left?

  • Get-Process | Select-Object Name | Where-Object Name -eq 'name-of-process'
  • Get-Process | Where-Object Name -eq name-of-process | Select-Object name-of-process
  • Get-Process -Name name-of-process | Select-Object Name

Module 4: Write your first PowerShell code

In this module, you begin learning the basics of programming by writing and running code in PowerShell.

Learning objectives:

After you’ve completed this module, you’ll be able to:

  • Manage PowerShell inputs and outputs.
  • Diagnose errors when you type code incorrectly.
  • Identify PowerShell elements such as cmdlets, parameters, inputs, and outputs.

Prerequisites:

None

This module is part of these learning paths:

Quiz 1: Knowledge check

Q1. How does PowerShell compile?

  • You run your code through a compiler as a step to outputting an executable program.
  • PowerShell is an interpreted language and your code will be interpreted to the computer as it runs.
  • PowerShell doesn’t compile at all, and the computer knows what your code says automatically.
  • PowerShell code is compiled to an AST, checked for issues, and then translated again so the computer can understand it.

Q2. Which of the following statements is true about PowerShell.

  • PowerShell is case sensitive.
  • Prompt is a cmdlet and Read-Host is a parameter.
  • You can enclose strings in either single or double quotation marks.
  • If you make a mistake when you write code, you have to delete it all and start over.

Q3. What is wrong with this line of code? Read-host "What is wrong with this line of code?"

  • The letter ‘h’ in Read-host should be uppercase.
  • It’s missing a semicolon at the end.
  • The string should be enclosed in single quotation marks.
  • Nothing is wrong with this command. It will run normally.

Module 5: Introduction to scripting in PowerShell

This module introduces you to scripting with PowerShell. It introduces various concepts to help you create script files and make them as robust as possible.

Learning objectives:

  • Understand how to write and run scripts.
  • Use variables and parameters to make your scripts flexible.
  • Apply flow-control logic to make intelligent decisions.
  • Add robustness to your scripts by adding error management.

Prerequisites:

  • Basic familiarity with using a command-line shell like Command Prompt or Git Bash
  • Visual Studio Code
  • Ability to install Visual Studio Code extensions
  • Ability to install software on your computer, if you’re not using a Windows operating system
  • Familiarity with running commands in PowerShell

This module is part of these learning paths:

Quiz 1: Knowledge check

Q1. Which file extension is correct for a script?

  • .pm1
  • .ps
  • .ps1

Q2. What’s the correct way to declare a required parameter?

  • Add this decorator: [Required].
  • Add this decorator: [Parameter(Mandatory)].
  • You can’t. You need to verify that parameter values are set

Q3. How can you cause a terminating error?

  • Use the keyword Throw followed by a string or object.
  • Create a new instance of the class Error, like this: new Error("error message")
  • Use the common parameter ErrorAction, like this: -ErrorAction Error
Conclusion:

I hope this Automate administrative tasks by using PowerShell Microsoft Quiz Answers would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

More Coding Solutions >>
Cognitive Class Answer

CodeChef Solution

Microsoft Learn

Leave a Reply

Your email address will not be published. Required fields are marked *