1) Explain what is PowerShell?
Power shell is an extendable command shell and a scripting language for Windows.
2) What are the key characteristics of PowerShell?
The key characteristics of PowerShell are
- PowerShell is object-based and not text based
- Commands in PowerShell are customizable
- It is a command line interpreter and scripting environment
3) In PowerShell what does variables holds?
In variables PowerShell contains strings, integers and objects. It does not have special variables as it is pre-defined with PowerShell
4) Explain what is the significance of brackets in PowerShell?
- Parenthesis Brackets (): Curved parenthesis style brackets are used for compulsory arguments.
- Braces Brackets <> : Curly brackets are employed in blocked statements
- Square Brackets []: They define optional items, and they are not frequently used
5) What does it mean cmdlet’s?
Cmdlet’s are simple build in commands written in .net language like C# or VB introduced by Windows PowerShell
6) Explain what is PowerShell Loop?
Automating repetitive task with the help of PowerShell loop is known as PowerShell Loop. Through PowerShell, you can execute For each loop, While loop and Do While loop.
7) Explain can you create PowerShell scripts for deploying components in SharePoint?
If you have created a web part using VS 2010 then, you can deploy it using cntrl+f5. However to activate the web part feature you can write a PowerShell script (.ps1) and execute it after deployment
8) Explain about the PowerShell’s comparison operators?
Comparison Operators compares value in PowerShell. Four types of comparison operators are used equality, match, containment and replace. In PowerShell, one of the key comparison operators is –eq that is used instead of “=” sign for declaring variables. Likewise, there are other operators like –ne for “not equal” , -gt ( greater than ) or –lt (less than).
9) Explain what is PowerShell pipeline is used for?
PowerShell pipeline is used for joining two statements such that the output of one statement becomes the input of the second.
10) Explain what is PowerShell get-command?
Get command in PowerShell is used to fetch other cmdlets, for example you are looking for cmdlet between letter L and R then your PowerShell get-command will be like
# PowerShell Get — Command Range
11) Explain with an example how you can map a network drive in PowerShell?
To map a network drive in PowerShell you have to use the command like
# PowerShell Map Network Drive
$Net = $( New — Object — ComObject Wscript.Network )
$Net.MapNetworkDrive( “S:”, \\expert\guru99 )
In here the drive letter is “S:” and the Network share is called ‘expert’ on a computer called ‘guru99.’
12) Mention what are the three ways that PowerShell uses to ‘Select’?
- The most common way is in a WMI Query Language (WQL) statement. In this technique Wmiobject uses ‘-query’ to introduce a classic ‘Select * from’ a phrase
- The second context for ‘Select’ in PowerShell is Select-String. This cmdlet checks for a word, phrase or any pattern match
- Another way is Select Object
13) What is the function of Get-ServiceStatus in PowerShell?
The cmdlets of windows enable you to filter the window services. PowerShell can list which services are ‘Running’ and which are ‘Stopped’ by scripting with windows.
14) Explain what PowerShell Scripting is?
PowerShell file contains a series of PowerShell commands with each command appearing on a separate line. To use a text file as a PowerShell script, its filename should have.PS1 extension. To run a script you need
- Type the commands in a text editor
- Save the file with .ps1 extension
- Execute the file in PowerShell
15) What is the use of hash table in PowerShell?
A hash table is also referred as dictionary. It is an array that allows you to store data in a “key-value” pair association. The “key” and “value” can be of any data and length. To declare a hash table you have to use @ followed by curly braces.
16) Explain what is the use of Array in PowerShell?
The use of Array in PowerShell is to run a script against remote computers. In order to create an array, you have to create a variable and assign the array. Arrays are represented by “@”symbol, they are represented as hashtable but not followed by curly braces.
For example, $arrmachine = @ ( “machine1” , “machine2” , “machine3”)
17) Mention what is the command that can be used to get all child folders in a specific folder?
To get all child folders in a specific folder, you have to use parameter recurse in the code.
Get-ChildItem C:\Scripts –recurse
18) Explain how you can convert the object into HTML?
To convert the object into HTML
Get-Process l Sort-object — property CPU –descending l convert to — HTML l Out-file “process.html”
19) Explain how you can rename a variable?
To rename a variable,
Rename-Item- Path Env: MyVariable –NewName MyRenamedVar
20) Explain what is the function of $input variable?
The $input variable enables a function to access data coming from the pipeline
21) What is the code to find the name of the installed application on the current computer?
Get-WmiObject-Class Win32_Product- ComputerName . l Format-wide-column1
22) Explain how you can find in PowerShell that all the sql services are on one server?
There are two ways to do this
- get-wmiobject win32_service l where-object
- get-service sql*
23) What is the best way to find all the sql services on one server?
There are two ways to do this.
- get-wmiobject win32_service | where-object
- get-service sql*
24) Which class can help us identify whether the m\c is 32 bit or 64?
win32_computersystem. This can be used as follows:
PS C:\> $server = gwmi -cl win32_computersystem
PS C:\> $server.SystemType X86-based PC
25) What is Variable Interpolation?
When you add a variable to a double-quoted string, PowerShell replaces the variable name by its value. This feature is called variable interpolation.
PowerShell Interview Questions
If you’re looking for PowerShell Interview Questions for Experienced and Freshers, you are at the right place. There are a lot of opportunities from many reputed companies in the world. According to research PowerShell developer salary per annum is about $90,000 pa. So, You still have the opportunity to move ahead in your career as PowerShell Developer. Mindmajix offers Advanced PowerShell Interview Questions 2022 that helps you crack your interview & acquire a dream career as PowerShell Developer.
Powershell Interview Questions and Answers
1. What is Microsoft PowerShell?
Microsoft PowerShell is a command-line shell and scripting language built on. NET. It helps system admins and power-users to quickly manage OS. (Windows, macOS, and Linux) and processes.
| Explore PowerShell Tutorial for more information |
2. Define the key features of PowerShell?
The prime characteristics of Microsoft PowerShell can be summed up as follows —
- PowerShell is a scripting environment
- PowerShell commands are customizable
- The programming language isn’t text-based. It’s object-based.
3. What makes up the variables in PowerShell?
- Objects
- Integers
- Strings
4. In PowerShell, what according to you is the implication of brackets?
- We use () Parentheses Brackets in compulsory arguments.
- We use <> Braces Brackets for blocked statements
- We do not normally use [] Square Brackets. These brackets specify optional items.
5. What is your understanding of cmdlet?
Cmdlet are commands scripted in languages such as PowerShell VB or C#.
6. Are you aware of PowerShell Loop?
When repetitive tasks are automated using PowerShell, it is called PowerShell Loop.
Subscribe to explore the latest tech updates, career transformation tips, and much more.

Subscribe Now
7. Can PowerShell scripts be created for the deployment of SharePoint components?
If the web part is created employing VS2010, SharePoint components can be deployed with the help of ctrl+f5. Features of the web part can be activated through the PowerShell script.
8. What is your idea about comparison operators in PowerShell?
Comparison operators in PowerShell compare values. Comparison operators can be classified into four types — Match, Equality, Replace, and Containment. To declare variables, –eq comparison is used. Similarly, –lt is used for less than’, -gt for ‘greater than’, and ‘not equal’ is denoted by –one.
9. What is the use of the PowerShell pipeline?
When we have to join two statements, we use the PowerShell pipeline. In this case, one statement’s output emerges as the second statement’s input.
10. What do you understand by get-command in PowerShell?
PowerShell’s get-command is applied to fetch cmdlets. For instance, if anyone is searching cmdlet between E and K, then the get-command would look like — get-command [ E–K ]*
11. Can you explain how the network drive is mapped in PowerShell?
For mapping network drive, the following PowerShell commands have to be executed —
# PowerShell Map Network Drive
12. Do you know the methods to ‘Select’ in PowerShell?
- The simplest way is WQL (WMI Query Language) statement. This technique uses the ‘-query’ in order to introduce ‘Select * from’.
- Select-String is the next method to ‘Select’ in PowerShell. In this scenario, the matching pattern, phrase, and word are checked by the cmdlet.
- The last way is through Select-Object.
13. What is PowerShell’s Get-ServiceStatus function?
The functions of Get-ServiceStatus enable filtering of window services. PowerShell lists the services that are ‘Running’, also, the services that are ‘Stopped’ through scripting.
Powershell Interview Questions For Experienced
14. Since you mentioned scripting, define what Scripting in PowerShell is?
PowerShell files contain an array of commands, where each command appears in separate lines. When using a text file, the filename will have the.PS1 extension. PowerShell script can be run by —
- Typing commands in a text editor
- Saving a file with the .ps1 extension
- Executing the file
15. Can you explain the hash table functions in PowerShell?
PowerShell’s hash table can be referred to as a dictionary. Basically, it is a series that enables users in storing data with a pair association known as “key-value”. Here, both “key”, as well as “value”, might comprise any length and data. In order to declare hash table users will have to apply @ in front of curly braces.
16. Can you explain the uses of PowerShell Array?
PowerShell Array is used to run scripts on remote computers. To create a PowerShell Array, users will need to create a variable, as well as they will have to assign the PowerShell Array. PowerShell Arrays are expressed with a “@” symbol and illustrated as a hashtable.
For instance, it would be like —
17. Define what commands to use in order to get child folders into a specified folder?
We will have to apply parameter recurse to get child folders into a specified folder. It will be —
Get-ChildItem C: Scripts –recurse
18. Can you explain the ways to convert the object to HTML?
In order to convert the object to HTML, we will have to execute —
19. Can you define how you will assign a different name to a variable?
A variable can be renamed by using —
Rename-Item- Path Env: MyVariable –NewName MyRenamedVar
20. Are you aware of the $input variable? What are its functions?
$input variable activates a function that enables pipeline data access.
21. Can you illustrate the code used to locate the names of installed applications on a current computer?
We will have to employ the following code:
— ComputerName. l Format-wide-column1
22. How do you think you will find that SQL services in PowerShell are in one server?
We can do this in two ways:
23. What according to you is an efficient way to locate all SQL services in one server?
In this case, also, we can do it in two ways:
24. Are you aware of the class that can enable us to identify if mc is 64 bit or 32 bit?
We can use this as follows:
25. What is your idea about Variable Interpolation?
When a variable is added to double-quoted strings, then PowerShell changes the name of that variable through its value. Typically, this feature in PowerShell is known as variable interpolation.
Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!
Powershell вопросы на собеседовании что такое
How do you comment out code in powershell?
Like other languages PowerShell also supports single/Inline comments line and multi line comments.
Starting with PowerShell V1 there’s only # to make the text after it a comment.
In PowerShell V2 «<# #>» can be used for block comments (multi-line) and more specifically for SYNOPSIS, DESCRIPTION, NOTES, LINK help comments.
Example: Sinlgle/Inline comments
# This is a single or inline comment starts with hash in Powershell
Example: Block comments (multi-line)
What is Windows Powershell ?
Windows PowerShell is a new Windows command-line shell designed especially for system administrators. In the SharePoint training Hyderabad administration context, Windows PowerShell is another administration tool that supersedes the existing Stsadm.exe.
Where is Powershell located in sharePoint ?
On the Start menu, click All Programs -> Click Microsoft SharePoint 2010 Products -> Click SharePoint 2010 Management Shell.
What are cmdlet’s?
Windows PowerShell introduces the concept of a cmdlet which are simple build in commands, written in a .net language like C# or VB.
Can you tell me two major differences between $Other_Language and PowerShell ?
This question is an fantastic opportunity get an insight into the candidate understanding of PowerShell core concepts and his/her favourite PowerShell features.
For example, one of the most fundamental difference between bash and PowerShell is that bash is text-oriented whereas PowerShell is object-oriented.
A good candidate should be able to tell that. A great candidate, would most likely go on and on about the benefits of the object-oriented nature of PowerShell.
Also, if a candidate cites 2 valid differences between the two languages, but not a major one, the candidate might have a partial knowledge of PowerShell.
How would you ping a remote computer with 5 packets using PowerShell ?
Again, this is basic stuff. I wouldn’t get caught up in ideology, the good old ping.exe is perfectly valid, as long as the candidate knows the option to specify 5 packets.
If you really want the more PowerShelly Test-Connection , then ask : I just want the command to return $True if the ping is successful and $False if it is not.
Powershell Scripting Interview Questions
What is the difference between ConvertTo-CSV and Export-CSV commands?
- ConvertTo-CSV is a one step process that only converts data into csv format and let it remain inside the shell
- Export-CSV is a 2 step process that not only converts data into CSV and also writes the output to a CSV format file.
How will you check the default path for PowerShell Modules ?
How will you check what commands have been added after adding the new snapin to powershell ?
Get-Command -pssnapin <snapin name> —> Lists all commands that got added when the snapin was added to the shell
What are the 4 types of FORMAT commands that can be used to format data?
- Format-Wide
- Format-List
- Format-Table
- Format-Custom
What is that path where PowerShell looks to get modules information and how would you know about them?
- C:\Users\. \Documents\WindowsPowerShell\Modules
- C:\Windows\system32\WindowsPowerShell\v1.0\Modules
What are two ways of extending PowerShell?
- PSSnapins
- Modules
You have servers that are not exposed to internet. How would you update help on those servers? Give commands
- Save-Help –DestinationPath <Path Name>
- Update-Help –SourcePath <Path Name> or Update-Help –SourcePath <Path Name> -Force
What are the 2 methods through which pipeline input would work?
- ByValue
- ByPropertyName
What argument can be used to convert an object into a string or convert the property of an object into the string?
expand is the argument that should be used with the property name to convert an object property simply into a string.
PowerShell Interview Questions
By
Priya Pedamkar

Introduction to PowerShell Interview Questions and Answers
PowerShell is a task automation software and configuration management framework created by the famous software company Microsoft. It consists of a command-line shell and also an associated scripting language. Earlier, PowerShell was a Windows component only, and it was known as Windows PowerShell, but later it was made open-source. After that, it also introduced PowerShell Core. Now PowerShell is a cross-platform framework. It was built on the .NET Framework and the latest version is built on .NET Core. PowerShell provides features such as full access to COM and WMI, which enables administrators to perform many administrative tasks on both local as well as remote Windows systems. It also provides a hosting API that can be used by the PowerShell runtime to be embedded inside with other applications. These applications then take maximum benefits of PowerShell functionality to implement certain operations which may include graphical interface etc.
Now, if you are looking for a job which is related to PowerShell then you need to prepare for the 2023 PowerShell Interview Questions. It is true that every interview is different as per the different job profiles. Here, we have prepared the important PowerShell Interview Questions and Answers which will help you get success in your interview.
Hadoop, Data Science, Statistics & others
In this 2023 PowerShell Interview Questions article, we shall present 10 most important and frequently used PowerShell interview questions. These interview questions are divided into two parts are as follows:
Part 1 – PowerShell Interview Questions (Basic)
This first part covers basic Interview Questions and Answers.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Q1. Explain what do you understand by PowerShell?
Answer:
- PowerShell is a shell designed keeping in mind the need of system administrators.
- It is open Source and Platform Independent i.e. works for Windows/Linux/Mac.
- It is object-oriented and not text-based.
- It is built on a .NET framework.
- It has an Interactive prompt and also a scripting environment.
Q2. Explain Execution Policies and types of Execution Policy?
Answer:
This is the common Interview Questions asked in an interview. There are 6 types of execution policies in PowerShell. These are:-
- Restricted: This is the default type. Under this, PowerShell will not run any script including PowerShell profiles too.
- RemoteSigned: PowerShell will only run any script that is created locally. Any script that has been coming from the Internet should be digitally signed with a signing certificate code and is trusted by the computer.
- AllSigned: PowerShell will only run any script that has been digitally signed using a trusted code signing certificate.
- Unrestricted: PowerShell will run any script. If the script comes from an untrusted source, users are prompted once to execute it.
- Bypass: This policy will run any script without any question or prompt.
- Undefined: There is no execution policy set for this in the current scope.
Q3. What is the PowerShell order in which execution policy is evaluated?
Answer:
Windows PowerShell has execution policies in the following order of precedence –
- Group Policy: Example is Computer Configuration.
- Group Policy: Example is User Configuration.
- Execution Policy: Such as Process (or PowerShell.exe -Execution Policy) – which is the CURRENT SCOPE.
- Execution Policy: Such as Current User – Which is SAVED in the HKCU registry.
- Execution Policy: Such as Local Machine – which is SAVED in the HKLM registry.
Q4. Explain the difference between CIM vs WMI.
Answer:
| Old WMI | New WMI | CIM |
| It has full form of Windows Management Instrumentation. | It has full form of Windows Management Instrumentation. | It has a full form of the Common Information Model. |
| Old WMI is actually Microsoft’s initial implementation of CIM. | New WMI was released along with WMF v3 in 2012 and it was compliant to new CIM standards. | It is Vendor-neutral and industry standard way of representation of management information. |
| It is Developed by Microsoft. | It is Developed by Microsoft as well. | It is Developed by another company called the DMTF. |
| It is there Since PowerShell v1. | It is Introduced in PowerShell v3. | Not available. |
| It used DCOM or Distributed COM) and RPCs Remote Procedure Calls. | It Uses WSMan and no more DCOM errors are possible with this. | It Uses WSMan which is a standard developed by DMTF. |
| It works for Windows only. | This also works for Windows only. | It can work in any Any platform. |
| It has RPC port- 135 for use. | It has WSMan Port – 5985 (HTTP) and 5986(HTTPS) for use. | It uses WSMan Port – 5985 (HTTP) and 5986(HTTPS) for its purpose. |
Q5. Further, differentiate between the concept of WMI between Old and new ideas.
Answer:
Old WMI
- Uses old-style native code providers and a repository for itself.
- Available only on Windows as mentioned.
- It has been more or less deprecated which means it’s is not focused on further improvement or development.
New WMI
- Supports old-style native code providers and a repository, as well as new-style MI providers as discussed.
- Available only on Windows as mentioned.
- This is the way forward. It has an essentially stateless relationship with the remote machine.
Part 2 – PowerShell Interview Questions (Advanced)
Let us now have a look at the advanced Interview Questions and Answers.
Q6. Differentiate between OMI and CIM.
Answer:
OMI
- It uses WS-MAN where OMI code includes the protocol stack od WS-MAN. It supports only new-style MI providers.
- It is available on any implementing platform. If something can talk to OMI, it will be able to talk to NEW WMI as well.
CIM
- It defines the standard. It is created by DMTF.
- In this case, early versions were implemented as OLD WMI actually by Microsoft, but the newest version implemented both in NEW WMI and OMI by Microsoft as well as others.
Q7. Provide distinction among WinRM and WSMan and DCOM.
Answer:
This is the most popular PowerShell Interview Questions asked in an interview.
WSMan
- WS-Management abbreviated as WSMAN or Web Services-Management is basically a Distributed Management task force.
- It is an open standard that defines a SOAP-based (full form Simple Object Access Protocol) protocol for the management of its servers, devices, applications and also various Web services.
WinRM
- WinRM is a feature that came from Windows Vista and it allows administrators to remotely run management scripts.
- It can handle remote connections using the WS-Management Protocol.
DCOM
- DCOM means Distributed COM.
- It is used to connect LIVE objects which are on the remote machine.
- The RPC protocol that it uses was designed for continuous back-and-forth messaging.
- It is network and memory inefficient.
Q8. What do you understand by Automatic variables?
Answer:
- Automatic variables are those that describe variables that store state information for PowerShell.
- These variables are mainly created and maintained by PowerShell itself.
Some of the very common Automatic Variables are as below:
- $$ – This variable contains the last token available in the last line received by the session.
- $? – This may contain the execution status of the last operation. Its value is TRUE if the last operation succeeded and FALSE if it failed.
- $^ – It may contain the first token of the last line received by the session.
Q9. What is $Error and $ForEach variable?
Answer:
$Error – This variable contains an array of error objects which represents the most recent errors. The most recent error is the first error in the array.
$ForEach – This variable contains the enumerator (should not be confused with the resulting values) of a for each loop. Properties and methods of enumerators can be used on the value of the $ForEach variable. This kind of variable exists only while the for each loop is in running state, and it is deleted once the loop is completed.
Q10. What are $Home and $PID?
Answer:
$Home – This variable contains the complete path of the user’s home directory. This variable can be considered as the equivalent of the %homedrive%%homepath% environment variables in windows such as C:\Users<UserName.
$PID – This may contain the process identifier of the process which is hosting the current Windows PowerShell session.
Recommended Articles
This has been a guide to the list of PowerShell Interview Questions and Answers so that the candidate can crackdown these PowerShell Interview Questions easily. Here in this post, we have studied top PowerShell Interview Questions which are often asked in interviews. You may also look at the following articles to learn more –