title: How to get backup path details once backup is completed using backup-sqldatabase in powershell
body: <p>I am trying to take SQL DB backup from PowerShell using backup-sqldatabase module using the below script. The module works fine with taking DB backup however I am unable to figure out the backup file name for further use.</p>
  
  <p>I have executed the below script but it is not taking $filename given by me also $db is null once the backup is completed.</p>
  
  <p>I need to get the backup file name once the backup is completed. </p>
  
  <pre><code>
  $FileNAme="$backupUrlContainer"+"automationPOC.bak"
  
  $db=Backup-SqlDatabase -BackupContainer $backupUrlContainer -SqlCredential $credentialName -Compression On -ServerInstance 'bp1amsdb419' -Database "Automation" -BackupFile $FileNAme ```
  </code></pre>