Export-SqlVulnerabilityAssessmentScan   
	Exports a Vulnerability Assessment scan to a file.
Syntax
Default (Default)
Export-SqlVulnerabilityAssessmentScan
    -ScanResult <ScanResult>
    -FolderPath <String>
    [-Force]
    [<CommonParameters>]
	Description
The Export-SqlVulnerabilityAssessmentScan cmdlet exports a Vulnerability Assessment scan to a file. Currently the command supports exporting a scan to Excel (.xlsx) file format only.
Module requirements: version 21+ on PowerShell 5.1; version 22+ on PowerShell 7.x.
This cmdlet was removed in v22.3+ of the module.
Examples
Example 1: Export a Vulnerability Assessment scan to Excel file
PS C:\> $scanResult = Invoke-SqlVulnerabilityAssessmentScan -ServerInstance "MyComputer\MainInstance" -Database some_database
PS C:\> $scanResult | Export-SqlVulnerabilityAssessmentScan -FolderPath "ScanResult.xlsx"
In this example, we invoke a Vulnerability Assessment scan on a database then export it to an Excel file.
Example 2: Iterate over databases on some servers and export VA scans to Excel files
PS C:\> @('localhost\SQL2016', 'localhost\SQL2017') |
  Get-SqlDatabase |
  Where-Object { $_.Name -like 'keep_*' } |
  ForEach-Object  {
    Invoke-SqlVulnerabilityAssessmentScan -ServerInstance $_.Parent -Database $_.Name |
    Export-SqlVulnerabilityAssessmentScan -FolderPath "$($env:TEMP)\$(($_.Parent).Name -replace '\\', '_' )_$($_.Name)_ScanResult.xlsx"
  }
PS C:\> dir "$env:TEMP\*_ScanResult.xlsx"
    Directory: C:\Users\someuser\AppData\Local\Temp
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        10/6/2018   1:19 AM          80050 SQL2016_keep_MDW_ScanResult.xlsx
-a----        10/6/2018   1:19 AM          80355 SQL2017_keep_MyDB_ScanResult.xlsx
-a----        10/6/2018   1:19 AM          79416 SQL2017_Keep_WideWorldImporters_ScanResult.xlsx
In this example, we show a simple way to quickly scan databases on a set of SQL Servers (in this case, 2 instances running on the local machine). The list of databases is filtered on the name, so only the ones whose names start with "keep_" are scanned). The results are stored under the TEMP folder in Excel files with a name that identifies the server and the databases the scan referred to.
Parameters
-FolderPath 
		Where the exported file will be saved
Parameter properties
| Type: | String | 
| Default value: | None | 
| Supports wildcards: | False | 
| DontShow: | False | 
Parameter sets
(All)
| Position: | Named | 
| Mandatory: | True | 
| Value from pipeline: | False | 
| Value from pipeline by property name: | False | 
| Value from remaining arguments: | False | 
-Force
Whether to force overwrite of the file if it already exists. If this parameter is not present, you will be prompted before the operation continues.
Parameter properties
| Type: | SwitchParameter | 
| Default value: | None | 
| Supports wildcards: | False | 
| DontShow: | False | 
Parameter sets
(All)
| Position: | Named | 
| Mandatory: | False | 
| Value from pipeline: | False | 
| Value from pipeline by property name: | False | 
| Value from remaining arguments: | False | 
-ScanResult 
		The Vulnerability Assessment scan result to export. The scan result must contain the relevant security checks' metadata.
Parameter properties
| Type: | ScanResult | 
| Default value: | None | 
| Supports wildcards: | False | 
| DontShow: | False | 
Parameter sets
(All)
| Position: | Named | 
| Mandatory: | True | 
| Value from pipeline: | True | 
| Value from pipeline by property name: | False | 
| Value from remaining arguments: | False | 
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.