Forum Discussion

Mark_Eades's avatar
Mark_Eades
Level 3
13 years ago

BEMCLI -WAIT for jobs !!

I am on that uphill struggle to adsorbe the syntax of powershell and I am having dubious success in trying to enable a -WAIT option for commandlets. With the sample below, on invoking successfully an...
  • pkh's avatar
    13 years ago

    Use Wait-BEJob to wait for your job to complete.  Your script should look like 

    Get-BETapeDriveDevice -Name "TAPE" | Submit-BEInventoryJob | Wait-BEJob | Write-Host 

     
    The Write-Host cmdlet is to write the job history to the console.  This will show the sucess/failure of the job.  There is no need for the loop.  If you put your import-module statement in your profile, then this statement is all that is needed.  See my article
     
    https://www-secure.symantec.com/connect/articles/preparing-your-powershell-environment-run-bemcli-and-scripts
     
    Also, there are a couple of other things that you can do with BEMCLI
     
    https://www-secure.symantec.com/connect/articles/using-bemcli-speed-tasks
     
    https://www-secure.symantec.com/connect/articles/use-bemcli-chain-jobs