Professional Documents
Culture Documents
I have been interviewing for last six years. Recently I added some "powershell questions" in my interview hurdles. I
would like SE and DBAs to prepare similar questions before you go for interviews.
Go through following list of questions and blog entries and BEAT IT.
Question 1. What is the best way to find all the sql services on one server?
Ans. There are two ways to do this.
1. get-wmiobject win32_service | where-object {$_.name -like "*sql*"}
2. get-service sql*
Question 2. Hw t find out which server and services are running under a specific account?
Ans. Go through my blog for this: Find out which server and services are running under a specific account
Question 3. How do you manage not to take any action for errors while executing powershell?
Ans: -ErrorAction Silentlycontinue
Question 4. Why do you get the error "Cannot bind argument to parameter 'Name' because it is null" in powershell?
Ans: Read my blog Starting Service Using Powershell Commands . I have also described to start the services in this
blog.
Search
Custom Search
Question 5. Which class can help us identify whether the m\c is 32 bit or 64?
Ans: win32_computersystem. This can be used as follows:
PS C:\> $server = gwmi -cl win32_computersystem
PS C:\> $server.SystemType
X86-based PC
Question 6. When do you get "getwmicomexception"?
Ans: Read Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
getwmicomexception,microsoft.powershell and getwmicomexception
Question 7. How to find using powersell if the system is 32 bit or 64 bit?
Ans: Read "How can I tell if my computer is running a 32-bit or a 64-bit version of Windows?"
Here
are
some
sample
PowerShell
interview
questions.
These are the kinds of questions that could be asked to gauge one's basic literacy and comfort level with
PowerShell.
Basic
literacy.
Describe
the
following:
a.
What
is
PowerShell?
Why
is
it
called
a
shell?
b. How does PowerShell differ previous Windows scripting techniques, such as CMD/batch files, VBScript,
etc.?
c.
What
is
a
cmdlet?
d.
What
is
meant
when
it's
said
that
Powershell
is
"object-based"?
e. What is the pipeline? How is it useful?
Get
the
amount
Ans:- Using WMI is an option
of
free
space
on
the
drive.
How
to
run
PowerShell
script?
Launch
PowerShell
Navigate to the directory where the script lives
PS> cd C:\test\ (enter)
Execute the script:
There
Please
is
alternate
way
to
see
run
powershell
script
below
using
POWERSHELL_ISE.
option.
How
to
prepare
Ans : Coming Soon..
window
bootable
Disc
using
powershell?
Is
PowerShell
ready
to
replace
my
cygwin
shell
on
Windows?
PowerShell
is
defiantly
looks
powerful
tool
for
windows.
The person who worked in heterogeneous environments Linux, Solaris and Mac OS X and cygwin.
Can differentiate better way. It is nice and more powerful tool environment seems to have been thought out
much
more
than
Unix
shells
as
it
use
of
objects
instead
of
text
streams.
Powershell
is
more
powerful
than
the
standard
built-ins
of
the
Unix
shells.
Note: - Using objects is a paradigm shift as compare to other environments and it avoids the whole re-parsing
at each step where structured data is involved.
How
to
use
powershell
to
download
old
version
of
package
with
nuget?
The powershell command Install-Package has a Version argument that can be used to specify a specific
version.
Get-Package
-ListAvailable
-Filter
Autofac
AllVersions
By pressing tab after the version option in the Install-Package command, you get a list of the latest available
versions.
Install-Package Autofac -Version 1.2.0