Export D365BacpacModelFile - FH-Inway/d365fo.tools GitHub Wiki
Extract the "model.xml" from the bacpac file
Export-D365BacpacModelFile [-Path] <String> [[-OutputPath] <String>] [-Force] [<CommonParameters>]
Extract the "model.xml" file from inside the bacpac file
This can be used to update SQL Server options for how the SqlPackage.exe should import the bacpac file into your SQL Server / Azure SQL DB
Export-D365BacpacModelFile -Path "c:\Temp\AxDB.bacpac"
This will extract the "model.xml" file from inside the bacpac file.
It uses "c:\Temp\AxDB.bacpac" as the Path for the bacpac file. It uses the default value "c:\temp\d365fo.tools" as the OutputPath to where it will store the extracted "bacpac.model.xml" file.
Export-D365BacpacModelFile -Path "c:\Temp\AxDB.bacpac" -OutputPath "c:\Temp\model.xml" -Force
This will extract the "model.xml" file from inside the bacpac file.
It uses "c:\Temp\AxDB.bacpac" as the Path for the bacpac file. It uses "c:\Temp\model.xml" as the OutputPath to where it will store the extracted "model.xml" file.
It will override the "c:\Temp\model.xml" if already present.
Export-D365BacpacModelFile -Path "c:\Temp\AxDB.bacpac" | Get-D365BacpacSqlOptions
This will display all the SQL Server options configured in the bacpac file. First it will export the bacpac.model.xml from the "c:\Temp\AxDB.bacpac" file, using the Export-D365BacpacModelFile function. The output from Export-D365BacpacModelFile will be piped into the Get-D365BacpacSqlOptions function.
Path to the bacpac file that you want to work against
It can also be a zip file
Type: String
Parameter Sets: (All)
Aliases: BacpacFile, File
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Path to where you want the updated bacpac file to be saved
Default value is: "c:\temp\d365fo.tools"
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: $Script:DefaultTempPath
Accept pipeline input: False
Accept wildcard characters: False
Switch to instruct the cmdlet to overwrite the "model.xml" specified in the OutputPath
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Tags: Bacpac, Servicing, Data, SqlPackage, Sql Server Options, Collation
Author: Mötz Jensen (@Splaxi)