Introduction
To enhance the usability of your scripts, you must learn how to accept user input. This skill allows you to create scripts that can be used for multiple purposes. In addition, accepting user input allows you to create scripts that are easier for others to use. In this module, you'll learn about multiple methods for accepting user input in a script.
Learning objectives
After completing this module, you'll be able to:
- Identify values in a script that are likely to change.
- Explain how to use Read-Host to accept user input.
- Explain how to use Get-Credential to accept user credentials.
- Explain how to use Out-GridView to obtain user input.
- Explain how to pass parameters to a script.
Prerequisites
Familiarity with:
- Windows networking technologies and implementation
- Windows Server administration, maintenance, and troubleshooting
- Windows PowerShell and its commands to perform specific tasks
- PowerShell cmdlets used for system administration tasks related to Active Directory, network configuration, server administration, and Windows 10 device administration
- Windows PowerShell pipeline, PowerShell providers, and PowerShell drives
- CIM and WMI technologies
- The use of variables, arrays, and hash tables in Windows PowerShell