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

Tuesday, May 24, 2016

PowerShell cmdlet of the Day : Clear-RecycleBin

Do you love sweets? I love them.  And there are some Powershell cmdlets those are tooo sweet like a sweet.

If you want to clear/ empty your recycle bin, there is a very sweet Powershell cmdlet available for it, which is Clear-RecycleBin .

Just run the cmdlet, and it will empty your recycle bin.  You can incorporate this cmdlet to your TEMP file cleaning scripts too.Clear-RecycleBin

If you just run the Clear-RecycleBin, it will ask you for Yes/No confirmation, you can -                        -Confirm:$false to omit it.

Clear-RecycleBin -Confirm:$false
Aman Dhally , Manya Kaur
So sweet isn't? :)
I have tested the above cmdlet on Windows 10 machine :)
Thanks
Aman Dhally , Manya Kaur

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

Monday, May 23, 2016

PowerShell cmdlet of the Day : Get-PrinterDriver

 

Ok! this is the simple one, it's mainly for the IT/System admins , who spend most of time on user's desk for troubleshooting.

If you are troubleshooting any printer issue, and want to check which printer driver is installed on the users system, shoot the Get-PrinterDriver cmdlet.

Tip : You can also connect to user's system remotely ;)

You can see in below screenshot that it's gives a list of all printer driver installed on the system.

wq1

Thanks :)

take-that

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, May 10, 2016

PowerShell cmdlet of the Day : Start-Sleep


Sometime, the more we move ahead, the more we start forgetting the basic things. It's in human nature I think or may be in mine :P .
Today when I was working on a PowerShell script, I come along with a cmdlet which I have used a lot in my early scripts.
The forgot cmdlet is "Start-Sleep".
It's hold the script activity for the period defined in it and it move to next line in the script after the define time in lapsed. For example if you set the Start-Sleep -Seconds 10, then it moved to next line after 10 seconds only.
Aman Dhally , Manya Kaur
The usage is simple., type Start-Sleep and then either use -seconds or -Milliseconds parameter and provide the value in number.

Simple, isn't :)

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