I am using the expdp command for backup and redirect the output into a text file. While this is in process, the console is blank. I would want to write a powershell script to display a status message as "In progress" until expdp command execution is completed. I tried using start-job command, however it fails to redirect the output into a text file as it is a background job. Any help here is appreciated. Below is the code used for start-job
$job = Start-Job -ScriptBlock {expdp username/password@database schemas="" directory="" dumpfile="" logfile="" REUSE_DUMPFILES=yes filesize=32G *> PROJECT.txt} -Name ExpdpJob
while ((Get-Job -Name ExpdpJob).State -eq "Running")
{
Write-Output "Expdp command is running"
}