New-AzureStorageDirectory

建立目錄。

警告

自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。

雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源

語法

New-AzureStorageDirectory
   [-ShareName] <String>
   [-Path] <String>
   [-Context <IStorageContext>]
   [-ServerTimeoutPerRequest <Int32>]
   [-ClientTimeoutPerRequest <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-ConcurrentTaskCount <Int32>]
   [<CommonParameters>]
New-AzureStorageDirectory
   [-Share] <CloudFileShare>
   [-Path] <String>
   [-ServerTimeoutPerRequest <Int32>]
   [-ClientTimeoutPerRequest <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-ConcurrentTaskCount <Int32>]
   [<CommonParameters>]
New-AzureStorageDirectory
   [-Directory] <CloudFileDirectory>
   [-Path] <String>
   [-ServerTimeoutPerRequest <Int32>]
   [-ClientTimeoutPerRequest <Int32>]
   [-DefaultProfile <IAzureContextContainer>]
   [-ConcurrentTaskCount <Int32>]
   [<CommonParameters>]

Description

New-Azure 儲存體 Directory Cmdlet 會建立目錄。 此 Cmdlet 會傳 回 CloudFileDirectory 物件。

範例

範例 1:在檔案共用中建立資料夾

PS C:\>New-AzureStorageDirectory -ShareName "ContosoShare06" -Path "ContosoWorkingFolder"

此命令會在名為 ContosoShare06 的檔案共用中建立名為 ContosoWorkingFolder 的資料夾。

範例 2:在檔案共享物件中指定的檔案共用中建立資料夾

PS C:\>Get-AzureStorageShare -Name "ContosoShare06" | New-AzureStorageDirectory -Path "ContosoWorkingFolder"

此命令會使用 Get-Azure 儲存體 Share Cmdlet 來取得名為 ContosoShare06 的檔案共享,然後使用管線運算符將它傳遞給目前的 Cmdlet。 目前的 Cmdlet 會在 ContosoShare06 中建立名為 ContosoWorkingFolder 的資料夾。

參數

-ClientTimeoutPerRequest

指定一個服務要求的用戶端超時時間間隔,以秒為單位。 如果先前的呼叫在指定的間隔內失敗,此 Cmdlet 會重試要求。 如果此 Cmdlet 在間隔經過之前未收到成功的回應,此 Cmdlet 會傳回錯誤。

類型:Nullable<T>[Int32]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ConcurrentTaskCount

指定並行網路呼叫上限。 您可以藉由指定並行網路呼叫數目上限,使用此參數來限制並行 CPU 和頻寬使用量的並行存取。 指定的值是絕對計數,不會乘以核心計數。 此參數可協助減少低頻寬環境中的網路連線問題,例如每秒 100 千位。 預設值為 10。

類型:Nullable<T>[Int32]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Context

指定 Azure 記憶體內容。 若要取得記憶體內容,請使用 New-Azure 儲存體 Context Cmdlet。

類型:IStorageContext
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Directory

將資料夾指定為 CloudFileDirectory 物件。 此 Cmdlet 會在此參數指定的位置中建立資料夾。 若要取得目錄,請使用 New-Azure 儲存體 Directory Cmdlet。 您也可以使用 Get-Azure 儲存體 File Cmdlet 來取得目錄。

類型:CloudFileDirectory
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Path

指定資料夾的路徑。 此 Cmdlet 會建立此 Cmdlet 所指定路徑的資料夾。

類型:String
Position:1
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-ServerTimeoutPerRequest

指定要求的伺服器部分逾時期間長度。

類型:Nullable<T>[Int32]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Share

指定 CloudFileShare 物件。 這個 Cmdlet 會在此參數指定的檔案共用中建立資料夾。 若要取得 CloudFileShare 物件,請使用 Get-Azure 儲存體 Share Cmdlet。 這個物件包含記憶體內容。 如果您指定此參數,請勿指定 Context 參數。

類型:CloudFileShare
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-ShareName

指定檔案共享的名稱。 這個 Cmdlet 會在此參數指定的檔案共用中建立資料夾。

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

輸入

CloudFileShare

參數:共用(ByValue)

CloudFileDirectory

參數:目錄(ByValue)

String

IStorageContext

輸出

CloudFileDirectory