I have written a script in powershell to do some reporting on a DPM server. The script itself runs fine, but when I add "start-transcript $filename -append" it asks me "Are you sure you want to perform this action?" (then the rest of the standard text). I have added a -force option to the end of the command, but it still asks me the same question.
I have noticed this behavior with other commands that write files, is there a global variable that powershell uses to override -force and prompt for any disk writes? Is anyone able to make any suggestions as to what may be the issue here?
Ok, I've found out what the problem was - there is a global variable $ConfirmPreference, which confirms, well, the confirm preference - I did a "write-host $confirmpreference" and it was set to "Low", I then did a $confirmpreference="High" and this has resolved the issue.