Do you use the PowerShell Transactions supporting cmdlets? Looks like the transaction is being commited only after your script runs out.
Try to split the deploying logic into two transactions: creating the cube and the other actions you need to perform. For each of this parts you should use it's own transaction, like this:
Start-PSTransaction
// logic
Complete-PSTransaction
If you need to access the transactions programmatically, you should use the TransactionScope
analog in the PowerShell, the Cmdlet's CurrentPsTransaction
property, like this:
using(CurrentPsTransaction)
{
... // Perform transactional work here
}
... // Perform non-transacted work here
using(CurrentPsTransaction)
{
... // Perform more transactional work here
}
Update:
May be you can turn on the transaction using the declaration?
Developing for transactions – Cmdlet and Provider declarations
Cmdlets declare their support for transactions in a similar way that they declare their support for ShouldProcess:
[Cmdlet(“Get”, “Process”, SupportsTransactions=True)]
Providers declare their support for transactions through the ProviderCapabilities flag:
[CmdletProvider(“Registry”, ProviderCapabilities.Transactions)]
More about the isolation levels in Powershell:
TransactionScope with IsolationLevel set to Serializable is locking all SQL SELECTs