37 lines
1.4 KiB
PowerShell
37 lines
1.4 KiB
PowerShell
Set-Variable -Scope Global -Name ScriptName -Value (($MyInvocation.MyCommand.Name) -split "\.")[0].ToString()
|
|
Set-Variable -Scope Global -Name ScriptPath -Value (Split-Path ($MyInvocation.MyCommand.Path))
|
|
Set-Variable -Scope Global -Name EDMIServerURL -Value "net.tcp://172.24.12.67:9000/DigitalData/Services/Main"
|
|
|
|
Import-Module "S:\Schrank\DigitalData.Modules.EDMIAPI.dll" -Force
|
|
Import-Module "S:\Schrank\DigitalData.Modules.Logging.dll" -Force
|
|
Import-Module "S:\Schrank\NLog.dll" -Force
|
|
|
|
Remove-Item -Path "E:\EDMILog\" -Filter *.log -Force -Recurse -ErrorAction SilentlyContinue
|
|
|
|
cls
|
|
|
|
#Logger initialisieren
|
|
$log = [DigitalData.Modules.Logging.LogConfig]::New([DigitalData.Modules.Logging.LogConfig+PathType]::CustomPath, "E:\EDMILog", $NULL)
|
|
$log.Debug = $True
|
|
$logger = $log.GetLogger()
|
|
$logger.Info("Logger ist initialisiert!")
|
|
$logger.debug("debug-Logger ist initialisiert!")
|
|
|
|
$document = [DigitalData.Modules.EDMIAPI.Document]::New($log, $EDMIServerURL)
|
|
$ImportFile = $document.ImportFile("E:\JenneJ\ghost.sql")
|
|
|
|
If ($ImportFile.OK -eq "false") {
|
|
|
|
Write-Host "War erfolgreich!"
|
|
|
|
} #end if
|
|
ELSE {
|
|
|
|
Write-Host $ImportFile.ErrorMessage
|
|
|
|
} #end else
|
|
|
|
#$ExportFile = $document.GetDocumentByDocumentId($ImportFile.Document.DocumentId)
|
|
$ExportFile = $document.GetDocumentByContainerId($ImportFile.Document.ContainerId)
|
|
|
|
[System.IO.File]::WriteAllBytes("E:\" + $ExportFile.Document.FileName, $ExportFile.Contents) |