Do not prompt when writing to output file in DPM PowerShell

By |2017-12-04T11:47:55+00:00April 14th, 2011|PowerShell|0 Comments

Just a quick one for anyone else that uses a DPM PowerShell command to output to a file and keeps getting prompted to perform the action:


If you are writing anything that has a for each clause in there then you can end up typing “Y” for each time it wants to write to the file.

All you need to do is add in the following option at the end of your line:


So the example command from above would read:

“What you want to output” | out-file “c:outputfile.txt” -confirm:$false

The file should then overwrite without prompting.


Leave A Comment

like what you see? 

Sign-up to our newsletter and never miss out on the latest blogs, events and tech news from the world of risual
Give it a try, you can unsubscribe anytime.