Basics with Windows Powershell
()
About this ebook
Cmdlets are the heart-and-soul of Windows PowerShell, Microsoft's new command shell/scripting language. This series provides a task-based introduction to Windows PowerShell cmdlets: rather than focusing on the individual cmdlets themselves, the emphasis is on the tasks you can carry out using those cmdlets. These tasks include everything from reading and writing text files to managing event logs to sorting and filtering data.
Read more from Prometheus Mms
Windows Command Prompt A-N Rating: 5 out of 5 stars5/5Basics with Bitcoin Rating: 0 out of 5 stars0 ratings
Related to Basics with Windows Powershell
Related ebooks
The Complete Powershell Training for Beginners Rating: 0 out of 5 stars0 ratingsThe Windows Command Line Beginner's Guide: Second Edition Rating: 4 out of 5 stars4/520 Windows Tools Every SysAdmin Should Know Rating: 4 out of 5 stars4/5Getting Started with PowerShell Rating: 0 out of 5 stars0 ratingsLearn Batch File Programming! Rating: 1 out of 5 stars1/5Active Directory with PowerShell Rating: 4 out of 5 stars4/5Microsoft Windows Server Administration Essentials Rating: 0 out of 5 stars0 ratingsWindows Command Prompt Rating: 0 out of 5 stars0 ratingsPowerShell: A Comprehensive Guide to Windows PowerShell Rating: 4 out of 5 stars4/5Let's Use BASH on Windows 10! Rating: 0 out of 5 stars0 ratingsMastering PowerShell: Unleashing the Power of Automation: The IT Collection Rating: 5 out of 5 stars5/5Windows Server 2012 Automation with PowerShell Cookbook Rating: 0 out of 5 stars0 ratingsHow To Recover Deleted Files: Your Step-By-Step Guide To Recovering Deleted Files Rating: 0 out of 5 stars0 ratingsLet's Use Bash on Windows 10! The Lite version Rating: 0 out of 5 stars0 ratingsWindows Vista For Dummies Rating: 4 out of 5 stars4/5ConfigMgr - An Administrator's Guide to Deploying Applications using PowerShell Rating: 5 out of 5 stars5/5Practical Malware Prevention Rating: 0 out of 5 stars0 ratingsMastering PowerShell Scripting: Automate repetitive tasks and simplify complex administrative tasks using PowerShell Rating: 0 out of 5 stars0 ratingsLearning ParrotOS: Kickstart simple pentesting and ethical hacking techniques using cybersecurity operating system Rating: 0 out of 5 stars0 ratingsWindows Batch File Programming Rating: 2 out of 5 stars2/5Microsoft System Center PowerShell Essentials Rating: 0 out of 5 stars0 ratingsSimply Linux: Basics Rating: 5 out of 5 stars5/5Windows Security Basics: User Accounts Rating: 0 out of 5 stars0 ratingsCompTIA Linux+ Powered by Linux Professional Institute Study Guide: Exam LX0-103 and Exam LX0-104 Rating: 3 out of 5 stars3/5Troubleshooting and Maintaining Your PC All-in-One For Dummies Rating: 5 out of 5 stars5/5Windows 10 Anniversary Update Bible Rating: 0 out of 5 stars0 ratingsKali Linux Cookbook Rating: 4 out of 5 stars4/5PowerShell for SQL Server Essentials Rating: 0 out of 5 stars0 ratings
Computers For You
Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 4 out of 5 stars4/5The Self-Taught Computer Scientist: The Beginner's Guide to Data Structures & Algorithms Rating: 0 out of 5 stars0 ratingsData Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5The ChatGPT Millionaire Handbook: Make Money Online With the Power of AI Technology Rating: 4 out of 5 stars4/5Elon Musk Rating: 4 out of 5 stars4/5The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Fundamentals of Programming: Using Python Rating: 5 out of 5 stars5/5Storytelling with Data: Let's Practice! Rating: 4 out of 5 stars4/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsSQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Computer Science I Essentials Rating: 5 out of 5 stars5/5CompTIA Security+ Get Certified Get Ahead: SY0-701 Study Guide Rating: 5 out of 5 stars5/5CompTIA IT Fundamentals (ITF+) Study Guide: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsQuantum Computing For Dummies Rating: 3 out of 5 stars3/5Becoming a Data Head: How to Think, Speak, and Understand Data Science, Statistics, and Machine Learning Rating: 5 out of 5 stars5/5Get Started in UX: The Complete Guide to Launching a Career in User Experience Design Rating: 4 out of 5 stars4/5Deep Search: How to Explore the Internet More Effectively Rating: 5 out of 5 stars5/5Technical Writing For Dummies Rating: 0 out of 5 stars0 ratingsProcreate for Beginners: Introduction to Procreate for Drawing and Illustrating on the iPad Rating: 5 out of 5 stars5/5How To Become A Data Scientist With ChatGPT: A Beginner's Guide to ChatGPT-Assisted Programming Rating: 4 out of 5 stars4/5UX/UI Design Playbook Rating: 4 out of 5 stars4/52022 Adobe® Premiere Pro Guide For Filmmakers and YouTubers Rating: 5 out of 5 stars5/5Microsoft Azure For Dummies Rating: 0 out of 5 stars0 ratingsLearning the Chess Openings Rating: 5 out of 5 stars5/5
Reviews for Basics with Windows Powershell
0 ratings0 reviews
Book preview
Basics with Windows Powershell - Prometheus MMS
INTRODUCTION
Microsoft's new command shell/scripting language. This series provides a task-based introduction to Windows PowerShell cmdlets: rather than focusing on the individual cmdlets themselves, the emphasis is on the tasks you can carry out using those cmdlets. These tasks include everything from reading and writing text files to managing event logs to sorting and filtering data.
Applies To: Windows PowerShell 2.0, Windows PowerShell 3.0, Windows PowerShell 4.0
Graphical user interfaces use some basic concepts that are well known to most computer users. Users rely on the familiarity of those interfaces to accomplish tasks. Operating systems present users with a graphical representation of items that can be browsed, usually with drop-down menus for accessing specific functionality and context menus for accessing context-specific functionality.
A command-line interface (CLI), such as Windows PowerShell, must use a different approach to expose information, because it does not have menus or graphical systems to help the user. You need to know command names before you can use them. Although you can type complex commands that are equivalent to the features in a GUI environment, you must become familiar with commonly-used commands and command parameters.
Most CLIs do not have patterns that can help the user to learn the interface. Because CLIs were the first operating system shells, many command names and parameter names were selected arbitrarily. Terse command names were generally chosen over clear ones. Although help systems and command design standards are integrated into most CLIs, they have been generally designed for compatibility with the earliest commands, so the command set is still shaped by decisions made decades ago.
Windows PowerShell was designed to take advantage of a user's historic knowledge of CLIs. In this chapter, we will talk about some basic tools and concepts that you can use to learn Windows PowerShell quickly. They include:
• Using Get-Command
• Using Cmd.exe and UNIX commands
• Using External Commands
• Using Tab-Completion
• Using Get-Help
for example, they mention that using double quotes you can evaluate variables inside the strings:
$x = hello
$x world
results in hello world
but
$y = hello
,goodbye
$y[0] world
does not. So, trial and error commence and we try:
${y[0]} world
which also fail.
It would be a lot better if they bothered to explain exactly how the various basic tokens are built up, for example what goes into a script block? will for example:
$x=hello
0..4 | foreach-object -process { $x world $_
}
Give the expected result? Yes, it does!
But for some reason using $args inside foreach does not - because presumably foreach-process has it's own arguments which replaces the $args variable, probably best then to store the $args into another variable and then use it? Yes, that works.
Things would be a lot easier if they bothered to have a few chapters to explain these basic stuff rather than having each of us finding out by experimentation.
Seems they skip immediately to the fun part and drop the tedious basic building blocks of the scripting language.
Also, if they could allow a character to escape the meaning of $ inside double quoted strings so you could write stuff like:
\$x = '$x'
To get the output
$x = 'Hello'
but that is not just documentation, that is change of the language. Yes, I know you can get the same
string by doing:
($
+x = '$x'
)
but it is easier to write \$x = '$x'
to achieve the same thing.
About Windows PowerShell
Discoverability
Windows PowerShell makes it easy to discover its features. For example, to find a list of cmdlets that view and change Windows services, type:
get-command *-service
After discovering which cmdlet accomplishes a task, you can learn more about the cmdlet by using the Get-Help cmdlet. For example, to display help about the Get-Service cmdlet, type:
get-help get-service
To fully understand the output of that cmdlet, pipe its output to the Get-Member cmdlet. For example, the following command displays information about the members of the object output by the Get-Service cmdlet.
get-service | get-member
Consistency
Managing systems can be a complex endeavor and tools that have a consistent interface help to control the inherent complexity. Unfortunately, neither command-line tools nor scriptable COM objects have been known for their consistency.
The consistency of Windows PowerShell is one of its primary assets. For example, if you learn how to use the