Powershell Interview Questions

Mention what are the main language or platform used for web-design?

The main language used for web-designing are

  • HTML: Base template
  • CSS: Styling
  • JavaScript: Functionality
  • PHP: Server side scripts

Explain how can you set an image as a background on web pages?

To set an image as a background on web page, point the body background to the name of your image you want to set as a background as shown below.

</head>tag.

<body background= “picture.gif”>

You can also fix the background image, so while using the scroll bar in the browser, it does not move.  To do this add the BGPROPERTIES tag as shown below
<body background = “picture.gif”bgproperties=”fixed”>

Explain how can you integrate CSS file to your webpage?

To integrate CSS file with any number of HTML files, you have to integrate the file after the <head> tag using “Link” property.

<head><Link REL=STYLESHEET HREF= “filename.css”Type=“text/css”></head>

List out some of the JQuery function used for webpage designing?

Some of the JQuery function used for webpage designing include

  • Simple slide panel
  • Simple disappearing effect
  • Chainable transition effect
  • Accordion#1 and Accordion#2
  • Animated hover effect
  • Entire block clickable
  • Collapsible panels
  • Image replacement gallery
  • Styling different link types

As a web-designer while declaring “delete” button what would be your color choice?

Make the “Delete” button more prominent by using color like Red, especially when you have to show two button side by side. Red is sign of caution, so that will definitely help the user to draw their attention.

Explain how can a developer learn about web design?

Developer can learn about web design by following tips

  • Visit website like “Smashing Magazine” to get better idea about web design
  • Another website is “ Best Web Gallery” can also be helpful to get insight of quality design and layouts
  • Try your hands on tools like Adobe Illustrator
  • Create dynamic website using MySQL and PHP
  • Learn basic languages as HTML, CSS, JavaScript, PHP or jQuery

Explain why do people clear the screen multiple times when using a calculator?

The older version of calculators have several “cancel” button (C, CE). The CE button will only clear the last entry but does not interrupt with the current computation.  For instance, if you enter 2+1 and then press CE, it would show 0, but the calculator expects a second operand for the addition. (2+ is still there in memory). So to ensure that nothing remains left in memory and to start a new calculation we often see people hitting clear button couple of times. It is not due to a flaw in the calculator’s design.

Mention why is the mouse cursor slightly tilted and not straight?

During beginning of mouse technology, it was found that given the low resolution of the screens in those days, drawing a straight line and a line at a 45 degree angle was easier to do and more recognizable than the straight cursor. Also, the tilted arrow can help the click position easier to calculate because the origin of the cursors bitmap was in the upper left. This saved the mouse tracking subroutine a calculation on every click.

Explain what is Grid system?

A grid system is a structure comprising a series of horizontal and vertical lines which intersect and used to arrange content.  It is a way of providing a system that designers can work with the structure and present content. For web design beginners, it is always suggested that they use the pre-made framework for web design as they are relatively easy to use.

While writing an error message what all things you need to take into consideration?

You need to take following things in consideration

  • Don’t use negative words
  • Clearly mention the error so that the user knows what to correct
  • Give user a clue or link to solve the error
  • Put the blame on yourself and not on the user

What is a CSS file? For what purpose it is used?

CSS is called as “cascading style sheets”. It is mainly used to open and control web pages. It is usually used for controlling web pages which include font sizes, font styles and colour combinations that is necessary for the webpage. CSS files makes changes globally as any change in a CSS file can also lead to an overall change in the website appearance. This means that any change in a certain CSS file can cause automatic changes to the pages that uses that certain CSS file and will display the changes.

Is CSS case sensitive?

No, CSS is not case sensitive. CSS is case insensitive under most of its control except for document mark-up language which is beyond its control.

What is external style sheet? How can we link it?

External style sheet is a template/document/file which contains style and appearance information which can be used to link the HTML document and a large number of HTML documents can be linked using external style sheets. The file document can be linked using the LINK tag under the HEAD element. Files containing style information should have a suitable extension. For example, style.css. The proper syntax for linking the file using external style sheet is <head><link rel =stylesheet href=”style.css” type=”text/css”></head>

How do I make a webpage that someone can simply just send me a mail by just clicking on text with subject?

We can apply this by using mailto command in an AHREF link tag given below:

< A href mailto:[email protected]?subject=enquiry””> click here to mail ABC</a>

How to align pictures so that they are one above the other?

By using the align statement in the IMG SRC tag.

<img src=”abdc.gif” align=top>. Align can also be modified as align=top, align=middle, align=centre etc.

What are the possible values for “position”?

The type of positioning used for the webpages can be determined by using “position” element. These include static, relative, fixed, inherit and absolute.

What are the different JavaScript types?

There are six types of JavaScript: Object, null, string, undefined, Boolean and number. Objects include functions, array and ordinary objects. Numbers may include integers and real1 numbers, and also include special values such as NaN and infinity. Strings include empty strings, ““,

What is called as negative infinity in JavaScript?

It is a number in JavaScript which is formed by dividing a negative number by zero. The number will return undefined, if used by negative infinity. Example: number.negative_infinity.

What does the NaN function do?

Return ‘true’ if the argument is not a number.

What does “1”+2+4 return?

Since the question contains strings and + sign is usually used for catenation, the answer returned will be 124.

Explain what is PowerShell?

Power shell is an extendable command shell and a scripting language for Windows.

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

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.

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

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.

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.

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.

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

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.

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
Clear-Host
Get-Command [ L–R ]*

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\myTectra )
In here the drive letter is “S:” and the Network share is called ‘expert’ on a computer called ‘myTectra.’

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

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.

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

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.

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”)

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

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”

Explain how you can rename a variable?

To rename a variable,
Rename-Item- Path Env: MyVariable –NewName MyRenamedVar

Explain what is the function of $input variable?

The $input variable enables a function to access data coming from the pipeline

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

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 {$_name-like “*sql*”}
  • get-service sql*

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 {$_.name -like “*sql*”}
  • get-service sql*

Which class can help us identify whether the mc 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

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.

Summary
Review Date
Reviewed Item
These Questions were useful for my interview. Thanks for sharing
Author Rating
51star1star1star1star1star