Showing posts with label Powershell Tricks. Show all posts
Showing posts with label Powershell Tricks. Show all posts

Wednesday, May 18, 2016

PowerShell cmdlet of the Day : Format-Volume

 

Do you remember old days, when we used to have Format.exe to create and format partitions? Good old days! Huh! after that comes the GUI, afterwards that everything is done by mouse clicks :D.

In windows8 and later version of it, PowerShell included a cmdlet Format-Volume, which format the new or existing partition. Cool!

You can use the Format-Volume in lot's of way, but the most basic and widely use of this command is to format a  partition.

The basic command to do it is :

Format-Volume -DriveLetter D -FileSystem NTFS -Full -Force

D1

In the above command, we are formatting the D drive and formatting as a NTFS file system and by providing -Full we are asking it to fully format it ( it will take time, if you don't use the -Full parameter , it used the -quick by default).

Simple :) isn't.

To know more about the cmdlet  visit : https://technet.microsoft.com/en-us/library/hh848665(v=wps.630).aspx 

 

With Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel
for PowerShell video tutorials. You can download all of my scripts from “Microsoft
TechNet Gallery”.

Wednesday, May 11, 2016

PowerShell cmdlet of the Day : Test-Connection


Ping! I can bet, that you use this command almost daily. We use Ping.exe to test networking by pinging IP Addresses or hostnames. If the reply comes then we know networking is working fine and if we get RTO's , then we know, networking is not working.

In PowerShell we have a cmdlet Test-Connection which does the same.

The usage is simple, type the Cmdlet Test-Connection and in -Count parameter provide the numbers of Pings you want to send.

Test-Connection 8.8.8.8 -Count 3

1
Cool!

Actually the most cool thing is , this cmdlet's -Quiet switch parameter.

When we provide the -Quiet parameter, the output comes in True or False ( Awesome!!!). If your  IP/Host is reachable , then the output result will be True, otherwise it will be False.  This comes quite handy when you need to do some network availability checks in to your script.

:)

With Regards.
Aman Dhally

If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel
for PowerShell video tutorials. You can download all of my scripts from “Microsoft
TechNet Gallery

Tuesday, February 16, 2016

PowerShell Tips : Getting Sound Card information by using PowerShell.

 

Music, Music, we all love that,, that music comes fromt he Sound Card, do you wanna know more about  it, run the below commnad ;o) .

Get-Wmiobject -class "Win32_SoundDevice" | Fl * -Force

111

With Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.