new-item extra output This topic contains 4 replies, has 4 voices, and was last updated by Rob Simmers 1 year, 5 months ago. Author Posts August 7, 2015 at 6:34 pm #28278 Shane LindbergParticipant when using the new-item cmdlet it gives the output of what appears to be get-childitem. Is this normal, PS C:\Users\shane> New-Item -type file test.txt Directory: C:\Users\shane Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 8/7/2015 9:30 PM 0 test.txt how would I supress this output? August 7, 2015 at 6:45 pm #28279 VaskenParticipant The documentation for New-Item (man New-Item) don't seem to provide any way of doing this, so short of piping the command to Out-Null I'm not sure what other options are available- though perhaps others on here do. PS C:\Users\shane> New-Item -type file test.txt | Out-Null August 7, 2015 at 7:11 pm #28280 Shane LindbergParticipant Thanks for the answer. I feel like it did not give me all the output in the other past times I ran it, only some of the times. I am feeling a bit crazy. August 8, 2015 at 5:12 am #28285 Richard SiddawayModerator New-Item -Type File -Name test1.txt | Out-Null [void](New-Item -Type File -Name test2.txt) New-Item -Type File -Name test3.txt > $null $nf = New-Item -Type File -Name test4.txt can all be used to mask output. I prefer the first one August 8, 2015 at 6:38 am #28289 Rob SimmersParticipant Another option: $null = New-Item -Type File -Name test1.txt -Path C:\temp -Force Author Posts You must be logged in to reply to this topic.