none
Log Error not working PowerShell V2

    Question

  •  Not able to log the error on Error.txt file below what am i doing wrong? I am using PS Version 2. Help me

    $CSV = Import-Csv C:\temp\QATestPrivate\QA-Private.csv

    try

    {

    $CSV | ForEach {

     New-Mailbox -Room -Name $_.Name.trim() -OrganizationalUnit "teksite.com/Project/OneEmail/Users" -DisplayName $_.DisplayName.trim() -database $_.Database

     Set-mailbox -Identity $_.Name.trim() -EmailAddressPolicyEnabled $false -HiddenFromAddressListsEnabled $false -ResourceCapacity $_.Capacity.trim()

    }

    } # End try

    Catch
    {

    $_.Exception.Message | Out-File C:\temp\QATestPrivate\errors.txt -append
    }


    • Edited by asif300 Thursday, November 21, 2013 7:41 PM
    Thursday, November 21, 2013 7:29 PM

Answers