Powershell Flashcards

1
Q

Describe PowerShell

A

As an interactive command shell; Windows PowerShell serves as a direct administrator interface for managing Windows systems. As a scripting and administrative programming environment; Windows PowerShell provides a platform for automating systems.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is interpretive programming language platform?

A

A programming language whose programs are not directly executed by the host cpu but rather executed (or said to be interpreted) by a software known as an interpreter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is Windows PowerShell different from other scripting languages such as VBScript and Perl?

A

Windows PowerShell is not about text processing. It’s about object handling!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is one way that you can combine commands or cmdlets in Windows PowerShell?

A

Using piplines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you use the modularity of cmdlets to perform a specific task?

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is required to run PowerShell?

A

Windows PowerShell uses Microsoft .NET Framework version 2.0 as a foundation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How the new cmdlets and aliases are invoked?

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How the aliases are assigned?

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What relationship b/w .NET Framework and PowerShell?

A

Windows PowerShell uses Microsoft .NET Framework version 2.0 as a foundation and is a scripting language for .NET object in the same way as VBScript is a scripting language for the COM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the benefits of having Windows PowerShell run on the .NET Framework?

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What makes PowerShell easier to automate?

A

Object orientation plus .NET features makes Windows PowerShell easy to automate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How can you take advantage of the object-oriented nature of Windows PowerShell?

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What other object-oriented framewords Windows operating system supports besides .NET?

A

COM and WMI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What other object-oriented framewords can be used by PowerShell?

A

.NET - COM - WMI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How can you combine .NET

A

COM, and WMI objects to facilitate your tasks?,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can PowerShell be extended?

A

Providers - Cmdlets - Scripts - functions - aliases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a cmdlet?

A

A commandlet (cmdlet) is a lightweight command used in the Windows PowerShell environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How does Exchange Management Shell (EMS) improve Windows PowerShell capabilities?

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What needs to be set to allow scripts to be executed?

A

set-executionpolicy remotesigned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What version of .NET is installed on Windows 2008 server?

A

.NET 3.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Why does PowerShell doesn’t run on Server Core?

A

.NET Framework doesn’t yet run on Server Core

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How PowerShell is installed on Windows 2008 server?

A

Server Manager via Administrative Tools and select add Feature

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Difference b/w Core server and Windows 2008 server?

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the path to Windows PowerShell executables?

A

c:\windows\system32\WindowsPowerShell\v1.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Is there a benefit to viewing the installation folder in Windows PowerShell?
...
26
What is the advantage of associating the .ps1 file extension with Notepad rather than Windows PowerShell?
To avaoid unwanted programs to be executed upon opening the ps1 file.
27
On which framework and runtime environment is Windows PowerShell based?
...
28
What is the default installation path of Windows PowerShell?
...
29
What is the default execution policy security level in Windows PowerShell version 1.0?
...
30
What are three kinds of objects that Windows PowerShell can work with?
...
31
How can the objects in Active Directory be managed in a domain controller which is running Core Server
using Windows PowerShell?,
32
Can the PowerShell scripts be used to manage Windows 2000 server or Windows 2000 Professional?
...
33
What is an object in PowerShell?
Object in PowerShell have interfaces, methods and properties
34
Which Framework offers a richer set of examples in which the computer configuration is changed by manipulating objects?
...
35
What does a method do?
Act on the object
36
Objects have types and kinds
TRUE
37
What is an object class?
An object class is the definition of the rules for an object: which properties are allowed. An object class is used as a template. All objects of the same class share similar traits, behaviors, and even some attribute values.
38
What are cmdlet?
Microsoft provides about 130 building blocks that perform many basic administrative functions; these fundamental tools are called cmdlets.
39
Get a list of all cmdlet available
Get-command
40
Display Help
Get-Help
41
Cmdlets are named using a ----------- naming convention?
Verb-Noun
42
List all cmdlets with verb Add?
Get-Command -Verb Add - Get-Command -Verb Add : Get : New : Remove : Set
43
Reterive cmdlets with a specific ver or noun respectively!
Two other options for Get-Command are to use the Verb or Noun parameters to retrieve cmdlets with a specific verb or noun respectively.
44
Reterive a list of processes running
Get-Process
45
List running process with process id 0 and 5
Get-Process -id 0;5
46
List running process with a process name called spooler?
Get-Process -name processname1; processname2; ....;processnamen
47
Get help on Get-Process help command
Get-Help Get-process
48
Get detailed full help and Examples on Get-Process cmdlet
Get-Help Get-process -[detailed] [full][examples]
49
List common parameters
Verbos - Debug - ErrorAction - ErrorVariable - OutVariable - OutBuffer
50
List the common parameters that affect system configuration
WhatIf - Confirm
51
How does profile help?
Profiles enables you to define aliases in advance
52
Type the command to view (store) command history
Get-History
53
Type the command to rerun (invoke) a specific previous command
Invoke-History
54
Type the command to add items artificially to the history
Add-History
55
Define: binary module
A Windows PowerShell module whose root module is a binary module file (.dll). A binary module may or may not include a module manifest
56
Define: cmdlet
A task-oriented command that is used in the Windows PowerShell environment.
57
Define: common parameter
A parameter that is added to all cmdlets and advanced functions by the Windows PowerShell engine
58
Define: dot source
to start a command by typing a dot and a space before the command. Commands that are dot sourced run in the current scope instead of in a new scope
59
Define: dynamic module
A module that exists only in memory. The Import-PSSession cmdlet creates dynamic modules
60
Define: dynamic parameter
A parameter that is added to a Windows PowerShell cmdlet, function, or script under certain conditions. Cmdlets, functions, providers, and scripts can add dynamic parameters.
61
Define: formatting file
A Windows PowerShell XML file that has the .format.ps1xml extension and that defines how Windows PowerShell displays an object based on its .NET Framework type.
62
Define: global session state
The session state that contains the data that is accessible to the user of a Windows PowerShell session
63
Define: host
The interface that the Windows PowerShell engine uses to communicate with the user
64
Define: host application
A program that loads the Windows PowerShell engine into its process and uses it to perform operations
65
Define: input processing method
A method that a cmdlet can use to process the records it receives as input. BeginProcessing, ProcessRecord, EndProcessing, StopProcessing method
66
Define: manifest module
A Windows PowerShell module that has a manifest and whose ModulesToProcess key is empty
67
Define: module manifest
A Windows PowerShell data file (.psd1) that describes the contents of a module and that controls how a module is processed
68
Define: module session state
The session state that contains the public and private data of a Windows PowerShell module
69
Define: non-terminating error
An error that does not stop Windows PowerShell from continuing to process the command
70
Define: noun
The word that follows the hyphen in a Windows PowerShell cmdlet name. The noun describes the resources upon which the cmdlet acts
71
Define: parameter set
A group of parameters that can be used in the same command to perform a specific action
72
Define: pipe
to send the results of the preceding command as input to the next command
73
Define: pipeline
A series of commands connected by pipeline operators
74
Define: PSSession
A type of Windows PowerShell session that is created, managed, and closed by the user
75
Define: root module
The module specified in the ModuleToProcess key in a module manifest
76
Define: runspace
the operating environment in which each command in a pipeline is executed
77
Define: script block
a collection of statements or expressions that can be used as a single unit. A script block can accept arguments and return values
78
Define: script module
A module whose root module is a script module file (.psm1). A script module may or may not include a module manifest
79
Define: script module file
A file that contains a Windows PowerShell script. The script defines the members that the script module exports. Script module files have the .psm1 file name extension
80
Define: shell
The command interpreter that is used to pass commands to the operating system
81
Define: switch parameter
A parameter that does not take an argument
82
Define: terminating error
An error that stops Windows PowerShell from processing the command
83
Define: transaction
An atomic unit of work. The work in a transaction must be completed as a whole; if any part of the transaction fails, the entire transaction fails
84
Define: types file
A Windows PowerShell XML file that has the .ps1xml extension and that extends the properties of Microsoft .NET Framework types in Windows PowerShell
85
Define: verb
The word that precedes the hyphen in a Windows PowerShell cmdlet name. The verb describes the action that the cmdlet performs
86
Define: Windows PowerShell
A command-line shell and task-based scripting technology that provides IT administrators comprehensive control and automation of system administration tasks
87
Define: Windows PowerShell command
The elements in a pipeline that cause an action to be carried out, either typed at the keyboard or invoked programmatically
88
Define: Windows PowerShell data file
Text file that has the .psd1 extension. PowerShell uses data files for various purposes such as storing module manifest data and storing translated strings for script internationalization
89
Define: Windows PowerShell drive
virtual drive that provides direct access to a data store. It can be defined by a Windows PowerShell provider or created at the command line
90
Define: Windows PowerShell ISE
application that enables you to run commands and to write, test, and debug scripts in a friendly, syntax-colored, Unicode-compliant environment
91
Define: Windows PowerShell module
self-contained reusable unit that allows you to partition, organize, and abstract your Windows PowerShell code
92
Define: A PS module can contain:
cmdlets, providers, functions, variables, and other types of resources that can be imported as a single unit
93
Define: PowerShell provider
.NET Framework-based program that makes the data in a specialized data store available in Windows PowerShell so that you can view and manage it
94
Define: PowerShell snap-in
resource that defines a set of cmdlets, providers, and Microsoft .NET Framework types that can be added to the Windows PowerShell environment
95
How would you do the following activity in Powershell: print working directory
pwd
96
How would you do the following activity in Powershell: who am i
whoami
97
How would you do the following activity in Powershell: make directory
mkdir
98
How would you do the following activity in Powershell: change directory
cd
99
How would you do the following activity in Powershell: list directory
ls
100
How would you do the following activity in Powershell: remove directory
rmdir
101
How would you do the following activity in Powershell: push directory
pushd
102
How would you do the following activity in Powershell: pop directory
popd
103
How would you do the following activity in Powershell: copy a file or directory
cp
104
How would you do the following activity in Powershell: robust copy
robocopy
105
How would you do the following activity in Powershell: move a file or directory
mv
106
How would you do the following activity in Powershell: page through a file
more
107
How would you do the following activity in Powershell: print the whole file
type
108
How would you do the following activity in Powershell: run a command on lots of files
forfiles
109
How would you do the following activity in Powershell: find files
dir /r
110
How would you do the following activity in Powershell: find things inside files
select-string
111
How would you do the following activity in Powershell: read a manual page
help
112
How would you do the following activity in Powershell: find what man page is appropriate
helpctr
113
How would you do the following activity in Powershell: print some arguments
echo
114
How would you do the following activity in Powershell: export/set a new environment variable
set
115
How would you do the following activity in Powershell: exit the shell
exit
116
How would you do the following activity in Powershell: DANGER! become super user root DANGER!
runas
117
How would you do the following activity in Powershell: change permission modifiers
attrib
118
How would you do the following activity in Powershell: change ownership
iCACLS