Use this script to take an existing DacPac or Bacpac and extract it to a folder structure. 

.\DacToFile.ps1 -dacpacPath c:\temp  -dacpac = 'your.dacpac'

 

A folder structure than will be created similar to what is shown below:

 

   Directory: C:\temp\db

Mode                LastWriteTime         Length Name                                                                                                          
----                -------------         ------ ----                                                                                                          
d-----         3/5/2018   7:10 PM                Assembly                                                                                                      
d-----         3/6/2018   9:04 AM                Contract                                                                                                      
d-----         3/5/2018   7:18 PM                DataType                                                                                                      
d-----         3/5/2018   7:19 PM                Endpoint                                                                                                      
d-----         3/5/2018   7:19 PM                Filegroup                                                                                                     
d-----         3/6/2018   9:04 AM                MessageType                                                                                                   
d-----         3/5/2018   7:20 PM                Queue                                                                                                         
d-----         3/5/2018   7:20 PM                Role                                                                                                          
d-----         3/5/2018   7:20 PM                Schema                                                                                                        
d-----         3/6/2018   9:04 AM                Service                                                                                                       
d-----         3/5/2018   7:20 PM                Table                                                                                                         
d-----         3/5/2018   7:20 PM                User                                                                                                          
d-----         3/5/2018   7:20 PM                UserDefinedType                                                                                               
-a----         3/5/2018   7:06 PM              0 [Microsoft.SqlServer.Types].sql   
PowerShell
Edit|Remove
param($dacpacPath = 'c:\dacpacPath', $dacpac = 'your.dacpac') 
add-type -path 'C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\Microsoft.SqlServer.Dac.Extensions.dll' 
cd $dacpacPath 
$model =[Microsoft.SqlServer.Dac.Model.TSqlModel]::new(((get-item ".\$dacpac").fullname)) 
$queryScopes = [Microsoft.SqlServer.Dac.Model.DacQueryScopes]::All 
$returnObjects = $model.GetObjects([Microsoft.SqlServer.Dac.Model.DacQueryScopes]::All) 
$s = '' 
foreach($r in $returnObjects) 
{ 
   if ($r.TryGetScript([ref]$s)) 
   { 
    $objectTypeName = $r.ObjectType.Name; 
    $d="c:\temp\db\$objectTypeName" 
    if(!(test-path $d )) 
    { 
        new-item $d -ItemType Directory 
    } 
    $filename = "$d\$($r.Name.Parts).sql" 
         
        if (! (test-path $filename)) 
        { 
            Try 
            { 
                new-item $filename -ItemType File -ErrorAction Stop -Force 
            } 
            Catch 
            { 
                $url = "$($r.Name.Parts)" 
                if ([system.uri]::IsWellFormedUriString($url, [system.urikind]::Absolute)) 
                { 
                    $u = ([uri]"$url").Segments[-1] 
                    $filename = "$d\$u.sql" 
                    new-item $filename -ItemType File -ErrorAction Stop -Force 
                } 
                 
            } 
        } 
        $s | out-file  $filename -Force 
    write-output $filename 
   } 
 
} 
 A full explanation of the script can be found here: https://powershellposse.com/2018/03/06/dacpac-to-folders-with-powershell/