Powershell

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4
At a glance
Powered by AI
PowerShell is a command-line and scripting environment built on .NET. It allows administrators to automate tasks and configure Windows systems. Some key components include cmdlets, providers, functions and variables.

Some main components of PowerShell include cmdlets, .NET Framework, providers, functions, variables, and modules. Cmdlets are the basic commands in PowerShell for performing tasks. The .NET Framework provides the foundation. Providers allow access to different data stores. Functions and variables can be used to store and reuse code. Modules contain related cmdlets, functions and variables that can be imported as a unit.

Common PowerShell cmdlets include Get-Command, Get-Process, Get-Service, Get-ChildItem. Get-Command is used to find available cmdlets. Get-Process gets running processes. Get-Service gets Windows services. Get-ChildItem (alias ls) gets files and folders. Other examples are Where-Object, Select-Object, Sort-Object for filtering and formatting output.

- Powershell is built on _____________.

.NET Framework

- Which of the version of .Net Frame work is required to install PowerShell version
4?
.Net Framework 4.5

- _____________ is the feature of Commnd Line Tools.


XXAutomation can be implemented easily

- Which of the following are Command Line Tools?


All the options mentioned

- List out the PowerShell command types.


All the options mentioned

- What is the command to find total number of "FUNCTION" Commands?


(Get-Command -type function).count

- PowerShell command is in ___________________ format.


Verb-Noun format

- What is the command to list out the files and folders in the directory?
Get-Childitem

- Function of the Pipeline is _______________.


All

- Foreach-Object cmdlet is used to __________.


Perform an action on each object

- Where-Object cmdlet is used to __________.


XXPerform an action on each object

- Select-Object cmdlet is used to __________.


Display the list of objects based on the selected property

- Pipeline Symbol in PoweShell is _____.


"|"

- Sort-Object cmdlet is used to __________.


Sort the list f the object based on the selected property

- In the command below, how will the value of the variable "$name" be set?
$ name=user1
Write-host "$name"
Value will be supplied through a script file

- PowerShell commands are case sensitive.


False

- Command to find the PowerShell Version is _____________.

$PSVersiontable

- To run ".PS1" files, the execution policy must be set to __________.


Restricted

- In the following command, "-as secured string" is used to ___________.


$ password=Read-host "Enter Your Password" -assecured string
To enter the password securely

- Which of the following are Session Specific commands?


Alias Commands

- ISE is available from _______.


PowerShell 1.0

- PowerShell command to view all the properties of a specific Process like


"Notepad" is Get-Process notepad | Select-Object -Property *.
False

- PowerShell module can contain _______.


cmd lets, providers,fuctions, variables that can be imported as a single unit.

- The command Get-Process | Where-Object{$_.ProcessName -match "^p. *"} filters the


Processes by Process name and lists the Processes which
contains the Alphabet "P"

- Open source of PowerShell version is available from the year _______.


2016

- Error Action Preference specifies the desired behavior for ___________ in


PowerShell
a terminating error

- Command to display process name and ID of all process is get-process ______.


Select-Object process name, ID

- Open Source Version of PowerShell contains full set of commands.


False

- Integrated scripting environment is ______ for PowerShell.


host application

- Variables starts with ______.


"$"

- Which is an equivalent PowerShell command for "ls"?


get-childitem

- PowerShell for Ubuntu can be downloaded _______________.


As a Debian Package

- Write-host is used to ______.


Display messages in the PowerShell console

- Shell is _______ that is used to pass commands to the OS.


cmd encoder

- Get-Process | Sort-Object -Property Handles | Select-Object -Last 5 The output of


the above command will be the
List of 5 Process, having lower handles values

- When PowerShell 2.0 is updated with PowerShell 3.0, then ___________.


None of the options mentioned

- Alias name of the Format-table is _________.


fc

- Command to display the examples of get-service ______________.


All the options mentioned

- Using PowerShell, we can administrate _____________.


Servers and Workstations locally and remotely

- The default version of PowerShell in Windows 7 is _____________.


PowerShell 2.0

- Which of the following is a/are PowerShell command type(s)?


All the options

- Alias commands are _____________.


Function Commands

- The function(s) of the Pipeline is/are _______________.


All the options

X- Shell is a _______ that is used to pass commands to the OS


cmd interpreter

X- Package management module is available in ________


PowerShell 3.0

X- If $Name="User1" then the command $name.gettype() provides the information


on___________
Type of the variable value

X-

Pssession is ________.R.- Created, Managed and closed by a local system user

*Which of the following are Session Specific commands? XXXXXR.- Alias Commands

When PowerShell 2.0 is updated with PowerShell 3.0, then ___________R.- PowerShell
2.0 will be replaced by PowerShell 3.0 PowerShell 2.0 cannot be updated with
PowerShell 3.0

* PowerShell 2.0 is left on the SystemPowerShell commands are case sensitive.R.-


FIf

$Name="User1" then the command $name.gettype() provides the information


on___________? XXXXXXR.- Type of the variable

valueOpen source of PowerShell version is available from the year _______.R.- 2016

In the following command, "-as secured string" is used to ___________.


$password=Read-host "Enter Your Password" -assecured stringR.- To enter the
password securely
PowerShell for Ubuntu can be downloaded _______________.R.- As a Debian Package
Get-Variable cmdlet displays the list ofR.- Both Pre-Defined and User-Defined
Variables
Variables starts with ______.R.- "$"
Alias name of the Format-table is
R.- ftPowerShell cmdlets performs system administration tasks such as managingR.-
AllThe command Get-Process | Where-Object{$_.ProcessName -match "^p. *"} filters
the Processes by Process name and lists the Processes whichR.- contains the
Alphabet "P"Write-host is used to ______.R.- Display messages in the PowerShell
consoleCommand to display process name and ID of all process is get-process ______.
XXXXXR.- None

Error Action Preference specifies the desired behavior for ___________ in


PowerShellR.- a non-terminating error

Read-Host cmdlet is used toR.- Prompt the value of the variable


interactivelyCommand to display the examples of get-service ______________.R.-
AllTo get customized output _________ cmdlet is used ____________.R.- Write-
outputOpen Source Version of PowerShell contains full set of commands.R.-
TIntegrated scripting environment is ______ for PowerShell.R.- Host
applicationDefault version of PowerShell in Windows 10 is __________.R.- PowerShell
5.0Alias name of the Format-table is _________.R.- ftTo run ".PS1" files, the
execution policy must be set toR.- Remote SignedWhich is an equivalent PowerShell
command for "ls"?R.- get-childitem

Write-host is used to ______. - Display messages in the PowerShell consolePackage


management module is available in ________. - PowerShell 3.0The command Get-Process
| Where-Object{$_.ProcessName -match "^p. *"} filters the Processes by Process name
and lists the Processes which - ends with Alphabet "P"PowerShell for Ubuntu can be
downloaded _______________. - As a Debian PackagePowerShell cmdlets performs system
administration tasks such as managing ______________. - All the options
mentionedGet-Variable cmdlet displays the list of - Both Pre-Defined and User-
Defined VariablesCommand to display the examples of get-service ______________. -
All the options mentionedPowerShell variables are used to store _______. - Strings
and Number objectsCommand to find the PowerShell Version is _____________. -
$PSVersiontableVariables starts with ______. - "$"Integrated scripting environment
is ______ for PowerShell. - Host applicationOpen source of PowerShell version is
available from the year _______. � 2016
Command to display process name and ID of all process is get-process ______. - Both
Select-Object and FT can be used

You might also like