-1
如何執行一個將Action<T>
作爲Powershell中的參數的方法?帶動作的Powershell方法<T>參數
upgradeEngine.Configure(c => c.ScriptExecutor.ExecutionTimeoutSeconds = 15 * 60);
C#代碼:
var upgradeEngine = DeployChanges.To
.SqlDatabase(connectionString)
.WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
.LogToConsole();
//this line
upgradeEngine.Configure(c => c.ScriptExecutor.ExecutionTimeoutSeconds = 15 * 60);
//this line
upgradeEngine.Build();
Add-Type -Path (Join-Path -Path $currentPath -ChildPath 'x:\location\of\DbUp.dll')
$dbUp = [DbUp.DeployChanges]::To
$dbUp = [SqlServerExtensions]::SqlDatabase($dbUp, $connectionString)
$dbUp = [StandardExtensions]::WithScriptsFromFileSystem($dbUp, $scriptPath)
$dbUp = [StandardExtensions]::LogToConsole($dbUp)
$upgradeResult = $dbUp.Build().PerformUpgrade()
GSerg,沒有參數的使用從這個方法 –
我不確定你的意思,但委託接受一個參數'$ i'並使用它。 – GSerg