0
我已經問過這個問題前一些日子,但沒有人回答,我發現我的問題是什麼...MKDIR是緩慢的,這使得我的腳本崩潰
我創建這將是一個SharePoint服務器上某個文件夾用於將文件分類到它們中,如果我啓動它,則會拋出並上傳錯誤,因爲(當我停止使用斷點時),我看到我的mkdir命令沒有拋出任何錯誤消息,但我也沒有工作...
編輯:
我改變的mkdir到新建項目-ItemTyoe目錄,因爲我認爲日在作品更好!
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!"
}
這裏是上傳:
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!"
}
如果任何人有建議,我要感謝他(她):d
究竟是這樣的:*「它沒有工作」*或*「它確實有效,但它不能通過webclient立即顯示」*? –
它不會拋出任何錯誤,它沒有工作,但真正的問題是,我有一個路徑,我認爲他有一個問題'\\ workspace \ DavWWWRoot \ content \ 00000100 \ Research \ TestOffer \ documents \' –
因爲他拋出一個錯誤的網絡路徑未找到,需要多年才能打開此路徑,所以我認爲它很慢 –