Powershell Script taking too long -


i have powershell script involves creating multiple directories , command used create directory new-item -itemtype directory -force -path "abc\web-inf\classes\".

log creating directory path shows took 50 seconds(15:36:42 , 15:37:32) create 2 directories(web-inf,classes).this behaviour abnormal.is there other way can create directories save time.

2016-02-08 15:36:42 [stdout]pspath            : microsoft.powershell.core\filesystem::c:\abc 2016-02-08 15:36:44 [stdout]                    \web-inf\classes\ 2016-02-08 15:36:46 [stdout]psparentpath      : microsoft.powershell.core\filesystem::c:\abc 2016-02-08 15:36:49 [stdout]                    ment\web-inf 2016-02-08 15:36:51 [stdout]pschildname       : classes 2016-02-08 15:36:53 [stdout]psdrive           : c 2016-02-08 15:36:55 [stdout]psprovider        : microsoft.powershell.core\filesystem 2016-02-08 15:36:58 [stdout]psiscontainer     : true 2016-02-08 15:37:00 [stdout]name              : classes 2016-02-08 15:37:02 [stdout]parent            : web-inf 2016-02-08 15:37:05 [stdout]exists            : true 2016-02-08 15:37:07 [stdout]root              : c:\ 2016-02-08 15:37:09 [stdout]fullname          : c:\abc\web-inf\classes 2016-02-08 15:37:11 [stdout]extension         :  2016-02-08 15:37:14 [stdout]creationtime      : 08/02/2016 12:59:08 2016-02-08 15:37:16 [stdout]creationtimeutc   : 08/02/2016 12:59:08 2016-02-08 15:37:18 [stdout]lastaccesstime    : 08/02/2016 13:00:12 2016-02-08 15:37:21 [stdout]lastaccesstimeutc : 08/02/2016 13:00:12 2016-02-08 15:37:23 [stdout]lastwritetime     : 08/02/2016 13:00:12 2016-02-08 15:37:25 [stdout]lastwritetimeutc  : 08/02/2016 13:00:12 2016-02-08 15:37:27 [stdout]attributes        : directory 2016-02-08 15:37:30 [stdout]basename          : classes 2016-02-08 15:37:32 [stdout]mode              : d----- 

got bug . not command running slow. using

start-transcript -path "abc\def\ghi.log" -force -append 

which doesn't check whether directory (abc\def\ghi) exists . gives below log commands run after run till stop-transcript

transcript started, output file abc\def\ghi.log 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -