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
Q

Is there a benefit to viewing the installation folder in Windows PowerShell?

A

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

What is the advantage of associating the .ps1 file extension with Notepad rather than Windows PowerShell?

A

To avaoid unwanted programs to be executed upon opening the ps1 file.

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

On which framework and runtime environment is Windows PowerShell based?

A

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

What is the default installation path of Windows PowerShell?

A

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

What is the default execution policy security level in Windows PowerShell version 1.0?

A

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

What are three kinds of objects that Windows PowerShell can work with?

A

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

How can the objects in Active Directory be managed in a domain controller which is running Core Server

A

using Windows PowerShell?,

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

Can the PowerShell scripts be used to manage Windows 2000 server or Windows 2000 Professional?

A

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

What is an object in PowerShell?

A

Object in PowerShell have interfaces, methods and properties

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

Which Framework offers a richer set of examples in which the computer configuration is changed by manipulating objects?

A

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

What does a method do?

A

Act on the object

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

Objects have types and kinds

A

TRUE

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

What is an object class?

A

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.

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

What are cmdlet?

A

Microsoft provides about 130 building blocks that perform many basic administrative functions; these fundamental tools are called cmdlets.

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

Get a list of all cmdlet available

A

Get-command

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

Display Help

A

Get-Help

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

Cmdlets are named using a ———– naming convention?

A

Verb-Noun

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

List all cmdlets with verb Add?

A

Get-Command -Verb Add - Get-Command -Verb Add : Get : New : Remove : Set

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

Reterive cmdlets with a specific ver or noun respectively!

A

Two other options for Get-Command are to use the Verb or Noun parameters to retrieve cmdlets with a specific verb or noun respectively.

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

Reterive a list of processes running

A

Get-Process

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

List running process with process id 0 and 5

A

Get-Process -id 0;5

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

List running process with a process name called spooler?

A

Get-Process -name processname1; processname2; ….;processnamen

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

Get help on Get-Process help command

A

Get-Help Get-process

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

Get detailed full help and Examples on Get-Process cmdlet

A

Get-Help Get-process -[detailed] [full][examples]

49
Q

List common parameters

A

Verbos - Debug - ErrorAction - ErrorVariable - OutVariable - OutBuffer

50
Q

List the common parameters that affect system configuration

A

WhatIf - Confirm

51
Q

How does profile help?

A

Profiles enables you to define aliases in advance

52
Q

Type the command to view (store) command history

A

Get-History

53
Q

Type the command to rerun (invoke) a specific previous command

A

Invoke-History

54
Q

Type the command to add items artificially to the history

A

Add-History

55
Q

Define: binary module

A

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
Q

Define: cmdlet

A

A task-oriented command that is used in the Windows PowerShell environment.

57
Q

Define: common parameter

A

A parameter that is added to all cmdlets and advanced functions by the Windows PowerShell engine

58
Q

Define: dot source

A

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
Q

Define: dynamic module

A

A module that exists only in memory. The Import-PSSession cmdlet creates dynamic modules

60
Q

Define: dynamic parameter

A

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
Q

Define: formatting file

A

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
Q

Define: global session state

A

The session state that contains the data that is accessible to the user of a Windows PowerShell session

63
Q

Define: host

A

The interface that the Windows PowerShell engine uses to communicate with the user

64
Q

Define: host application

A

A program that loads the Windows PowerShell engine into its process and uses it to perform operations

65
Q

Define: input processing method

A

A method that a cmdlet can use to process the records it receives as input. BeginProcessing, ProcessRecord, EndProcessing, StopProcessing method

66
Q

Define: manifest module

A

A Windows PowerShell module that has a manifest and whose ModulesToProcess key is empty

67
Q

Define: module manifest

A

A Windows PowerShell data file (.psd1) that describes the contents of a module and that controls how a module is processed

68
Q

Define: module session state

A

The session state that contains the public and private data of a Windows PowerShell module

69
Q

Define: non-terminating error

A

An error that does not stop Windows PowerShell from continuing to process the command

70
Q

Define: noun

A

The word that follows the hyphen in a Windows PowerShell cmdlet name. The noun describes the resources upon which the cmdlet acts

71
Q

Define: parameter set

A

A group of parameters that can be used in the same command to perform a specific action

72
Q

Define: pipe

A

to send the results of the preceding command as input to the next command

73
Q

Define: pipeline

A

A series of commands connected by pipeline operators

74
Q

Define: PSSession

A

A type of Windows PowerShell session that is created, managed, and closed by the user

75
Q

Define: root module

A

The module specified in the ModuleToProcess key in a module manifest

76
Q

Define: runspace

A

the operating environment in which each command in a pipeline is executed

77
Q

Define: script block

A

a collection of statements or expressions that can be used as a single unit. A script block can accept arguments and return values

78
Q

Define: script module

A

A module whose root module is a script module file (.psm1). A script module may or may not include a module manifest

79
Q

Define: script module file

A

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
Q

Define: shell

A

The command interpreter that is used to pass commands to the operating system

81
Q

Define: switch parameter

A

A parameter that does not take an argument

82
Q

Define: terminating error

A

An error that stops Windows PowerShell from processing the command

83
Q

Define: transaction

A

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
Q

Define: types file

A

A Windows PowerShell XML file that has the .ps1xml extension and that extends the properties of Microsoft .NET Framework types in Windows PowerShell

85
Q

Define: verb

A

The word that precedes the hyphen in a Windows PowerShell cmdlet name. The verb describes the action that the cmdlet performs

86
Q

Define: Windows PowerShell

A

A command-line shell and task-based scripting technology that provides IT administrators comprehensive control and automation of system administration tasks

87
Q

Define: Windows PowerShell command

A

The elements in a pipeline that cause an action to be carried out, either typed at the keyboard or invoked programmatically

88
Q

Define: Windows PowerShell data file

A

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
Q

Define: Windows PowerShell drive

A

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
Q

Define: Windows PowerShell ISE

A

application that enables you to run commands and to write, test, and debug scripts in a friendly, syntax-colored, Unicode-compliant environment

91
Q

Define: Windows PowerShell module

A

self-contained reusable unit that allows you to partition, organize, and abstract your Windows PowerShell code

92
Q

Define: A PS module can contain:

A

cmdlets, providers, functions, variables, and other types of resources that can be imported as a single unit

93
Q

Define: PowerShell provider

A

.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
Q

Define: PowerShell snap-in

A

resource that defines a set of cmdlets, providers, and Microsoft .NET Framework types that can be added to the Windows PowerShell environment

95
Q

How would you do the following activity in Powershell: print working directory

A

pwd

96
Q

How would you do the following activity in Powershell: who am i

A

whoami

97
Q

How would you do the following activity in Powershell: make directory

A

mkdir

98
Q

How would you do the following activity in Powershell: change directory

A

cd

99
Q

How would you do the following activity in Powershell: list directory

A

ls

100
Q

How would you do the following activity in Powershell: remove directory

A

rmdir

101
Q

How would you do the following activity in Powershell: push directory

A

pushd

102
Q

How would you do the following activity in Powershell: pop directory

A

popd

103
Q

How would you do the following activity in Powershell: copy a file or directory

A

cp

104
Q

How would you do the following activity in Powershell: robust copy

A

robocopy

105
Q

How would you do the following activity in Powershell: move a file or directory

A

mv

106
Q

How would you do the following activity in Powershell: page through a file

A

more

107
Q

How would you do the following activity in Powershell: print the whole file

A

type

108
Q

How would you do the following activity in Powershell: run a command on lots of files

A

forfiles

109
Q

How would you do the following activity in Powershell: find files

A

dir /r

110
Q

How would you do the following activity in Powershell: find things inside files

A

select-string

111
Q

How would you do the following activity in Powershell: read a manual page

A

help

112
Q

How would you do the following activity in Powershell: find what man page is appropriate

A

helpctr

113
Q

How would you do the following activity in Powershell: print some arguments

A

echo

114
Q

How would you do the following activity in Powershell: export/set a new environment variable

A

set

115
Q

How would you do the following activity in Powershell: exit the shell

A

exit

116
Q

How would you do the following activity in Powershell: DANGER! become super user root DANGER!

A

runas

117
Q

How would you do the following activity in Powershell: change permission modifiers

A

attrib

118
Q

How would you do the following activity in Powershell: change ownership

A

iCACLS