1-Identify at least two differences between CLI and PowerShell. Explain why who
ID: 670390 • Letter: 1
Question
1-Identify at least two differences between CLI and PowerShell. Explain why who might use PowerShell.
2-You want to learn more about the dir command. Would you use /? or Help? Explain.
3-When executing instructions (syntax) inside the Windows Command prompt you type instead of clicking. To start you begin typing the name of an action you want to perform followed by additional information that may be required or optional. In total there are three parts to every instruction perform. What are the three parts of every instruction (syntax)?
Explanation / Answer
1)
PowerShell is actually very different from the command Prompt. It uses different commands, known as cmdlets in PowerShell.
Many system administration tasks from managing the registry to WMI(Windows Management Instrumentation) are exposed via PowerShell cmdlets, while they aren't accessible from command prompt.
PowerShell makes use of pipes, just as Linux and other Unix-like systems do. Pipes allow you to pass the output of one cmdlet to the input of another cmdlet, using multiple cmdlets in sequence to manipulate the same data.. Unlike Unix-like systems, which can only pipe streams of characters, PowerShell pipes objects between cmdlets. This allows PowerShell to share more complex data between cmdlets.
PowerShell is not just a shell to use. It's a powerful scripting environment that can be used to create complex scripts for managing Windows systems much more easily than you could with the command prompt.
The Command Prompt is essentially just a legacy environment carried forward in Windows- an environment that copies all of the various DOS commands you would find on a DOS system. It is painfully limited, can't access many Windows system administration features, is more difficult to compose complex scripts with, and so on. PowerShell is a new enviroment for Windows system administrators that allows them to use a more command-line enviroment to manage Windows.
Why to Use PowerShell:
2)
DIR can be used to display information about files from one or more directories, in a wide range of formats. Depending on the options chosen, you can display the first name, attributes, and size
The various DIR displays are controlled through options or switches. The best way to learn how to sue the many options available with the DIR command is to experiment.
You can select those options permanently by using the ALIAS command.
Example:
To display all the files in the current directory, in 2 columns, sorted veritcally and with a pause at the end of each page:
dir / 2 / p / v
To set up this format as the default, using an alias:
alias dir=*dir / 2 / p / v
3)
All commands have three parts:
The utility always comes first. The other two parts have different rules, depending on which command you are using: you may not have to use any flags or arguments at all.
Ex: $ ls -1 ~/Desktop
Where $ is symbol commonly used to indicate the command line,
ls is a utility,
-1 is a flag that alters how the utility operates,
~/Desktop is an argument to the utility.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.