fragte ich diese Frage schon ein paar Tage her, aber niemand antwortete, und ich fand heraus, was mein Problem ist ...Mkdir ist langsam, was mein Skript Absturz macht
ich einige Ordner auf einem Sharepoint Server zu schaffen, die sein wird, verwendet, um Dateien in sie zu sortieren und wenn ich es starte es wirft und Upload-Fehler, weil (wenn ich Haltepunkte zu stoppen) sehe ich, dass meine mkdir Befehl keine Fehlermeldung geworfen, aber ich habe auch nicht funktioniert ...
EDIT:
änderte ich mkdir nach New-Item -ItemTyoe Verzeichnis, weil ich dachte th funktioniert besser!
try {
#local file -> called "temporary" which will be created to down- & upload files (without this one the script won't work!!!)
New-Item -ItemType directory -Path $temp_local_file #it will be created on the paritition you entered at the top pf the program
#online files -> those files are created to have the same structure as in the template directory
New-Item -ItemType directory -Path $main_folder
New-Item -ItemType directory -Path $offer_folder
New-Item -ItemType directory -Path $delivery_folder
New-Item -ItemType directory -Path $order_folder
New-Item -ItemType directory -Path $review01_folder
} catch {
Write-Host -f Red "Folder konnten nicht erstellt werden!"
}
Und hier ist der Upload:
try {
$webclient.DownloadFile($reviewcomments, $review_download)
$webclient.DownloadFile($internal_project, $internal_project_download)
$webclient.DownloadFile($classification_document, $classification_download)
if($AVBInbox.Text -eq $AVB_languages[1]) {
$webclient.DownloadFile($AVB_en, $AVB_en_download)
Write-Host -f Green "Succesfully downloaded the english AVB"
}
elseif($AVBInbox.Text -eq $AVB_languages[0]) {
$webclient.DownloadFile($AVB_de, $AVB_de_download)
Write-Host -f Green "Succesfully downloaded the german AVB"
} else {
Show-MessageBox -Type Error -Message "An Error happened during the download of the AVB!"
}
} catch {
Write-Host -f Red "File Download failed, please retry!"
Show-MessageBox -Type Error -Message "Download failed please retry!"
}
Wenn jemand Vorschläge hat ich ihm oder ihr danken würde: D
Wich man es ist: * "Es hat nicht funktioniert" * oder * "Es hat funktioniert, aber es ist nicht sofort sichtbar durch den Webclient" *? –
Es wirft keinen Fehler, dass es nicht funktioniert hat, aber das eigentliche Problem ist, dass ich einen Pfad habe ich denke, er hat ein Problem mit \\ Arbeitsbereich \ DavWWWRoot \ content \ 00000100 \ Research \ TestOffer \ Dokumente \ ' –
weil Er wirft einen Fehler Netzwerkpfad nicht gefunden und es dauert Jahre, diesen Pfad zu öffnen, so denke ich, es ist ziemlich langsam –