I know I can use -Confirm:$false so supress any Confirm messages.
You could set $ConfirmPreference to None
Whether this is a good idea or not is another debate 🙂
yes, but that would have the same effect as using -Confirm:$false wouldnt it?
I wanted my script to run but if there is a Confirm-message it should be answered with 'No'
What I wanted to do was to call New-xDSCResource multiple times.
If the resource doesnt exist it is created, if it does exist you get a Confirm-question.
I know that I can use Test-xDscResource for a similar validation, but it will only validate that the resource is correct and won't detect if new properties are added.
You must be logged in to reply to this topic.