Need command to take the default option

Welcome Forums General PowerShell Q&A Need command to take the default option

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 6 years, 11 months ago.

  • Author
  • #6504

    Points: 0
    Rank: Member

    by curtissw at 2013-01-17 09:21:36

    I am trying to script deleting email from certain folders in a users mailbox and we are already using the polices for something eals and you canonly have one. I have everthing working if I run it manually but I can not automate it because it requires user input and I just need to hit the enter key. Is there a way to do this in powershell? In the old daye I would just pipe in a arrage return. A copy of the main parts of this scrpt is below.

    $today = (get-date).AddDays(-14).ToString("MM/dd/y")
    Export-Mailbox -Identity “general" -IncludeFolders "\001” -EndDate “$today" –DeleteContent

    by DonJ at 2013-01-17 15:36:46

    Are you experiencing a confirmation prompt, you mean? You're being asked to hit Yes or No? In that case, try adding -Force if the command supports it, or -Confirm], or both if supported.

    by curtissw at 2013-01-29 11:07:04

    The -Confirm:$false option worked.

    I thought that I tried that option but I must have typo it and it’s not listed as an available option so I may not have.

    Thanks again for your response!

The topic ‘Need command to take the default option’ is closed to new replies.