Thursday, May 12, 2016

PowerShell cmdlet of the Day : Test-Path

 

Believe me or not! you are going to use this cmdlet in almost all of your scripts.

By using Test-Path cmdlets, we can find if specific file / folder exists or now. If the file/folder does exists then the output is True, and if they don't then the output is False.

The basic usage of the cmdlet is simple, type the Test-Path cmdlet and in -Path parameter provide the name of file/folder which you want to test.

Test-Path -Path C:\temp\ad.txt

444

In above screenshot, the folder and file both exists, so the output of command in True.

555

In the above screenshot, neither the folder and file exists, so the output of command is false.

Cool! no :)

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

 

6 comments:

  1. Very useful information for people, I think this is what everyone needs. Dentistry research paper topics .

    ReplyDelete
  2. Our mission statement is to assist you every step of the way in writing you essay. If you looking wheare find ,"essay topic generator" Welcome to Scamfighter! By using our portal, you can rest assured that you will recive quality help with writing your essay.

    ReplyDelete
  3. In today's competitive job market, a well-written resume is a must. It is an unfortunate fact that recruiters are inundated with so many applications that they can spare no more than a cursory glance for each one, before deciding whether it is of further interest. It is becoming harder to make a resume stand out in the pile and this accounts for the rise of professional resume writing services. But with so many options, how do you choose the best? If you need "cover letter help", welcome to Resume101.org

    ReplyDelete
  4. The nursing thesis or nursing dissertation is the most timeconsuming and voluminous among the research works of various nursing programs. Therefore, we offer you professional assistance with nursing research paper topics. Let us facilitate your life and save your time and good mood for you, for when you order your nursing research papers, you will receive the top quality work. A well-organized teamwork assures of the best result possible.

    ReplyDelete
  5. I am not a guy who likes to share with others...sorry for being such an asshole, but I am not a very social person who makes 20 posts a day on Instagram. However, when I find something useful and I know that it works, I share this information with others. On the Internet, I found a thesis statement generator tool which can creates thesis statements for you. A very useful thing which saves a lot of time. Besides, it is free!

    ReplyDelete
  6. I just found a good topic for my work on essaytopicsgenerator.com , and the post I read on your site showed me what I want to write about in my paper. Thank you for inspiration!

    ReplyDelete