-
-
Notifications
You must be signed in to change notification settings - Fork 4
Invoke FSCPSAzureStorageDelete
Delete a file to Azure
Invoke-FSCPSAzureStorageDelete [-AccountId <String>] [-AccessToken <String>] [-SAS <String>]
[-Container <String>] -FileName <String> [-Force] [-EnableException] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Invoke-FSCPSAzureStorageDelete [-AccountId <String>] [-AccessToken <String>] [-SAS <String>]
[-Container <String>] -FileName <String> [-Force] [-EnableException] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Delete any file to an Azure Storage Account
$AzureParams = Get-FSCActiveAzureStorageConfig
PS C:\> New-D365Bacpac | Invoke-FSCPSAzureStorageDelete @AzureParams
This will get the current Azure Storage Account configuration details and use them as parameters to delete the file from Azure Storage Account.
Invoke-FSCPSAzureStorageDelete -AccountId "miscfiles" -SAS "sv2018-03-28&siunlisted&src&sigAUOpdsfpoWE976ASDhfjkasdf(5678sdfhk" -Container "backupfiles" -FileName "UAT_20180701.bacpac"
This will delete the "UAT_20180701.bacpac" from the "backupfiles" container, inside the "miscfiles" Azure Storage Account. A SAS key is used to gain access to the container and deleteng the file.
Storage Account Name / Storage Account Id where you want to store the file
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $Script:AzureStorageAccountId
Accept pipeline input: False
Accept wildcard characters: False
The token that has the needed permissions for the delete action
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $Script:AzureStorageAccessToken
Accept pipeline input: False
Accept wildcard characters: False
The SAS key that you have created for the storage account or blob container
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $Script:AzureStorageSAS
Accept pipeline input: False
Accept wildcard characters: False
Name of the blob container inside the storage account you want to store the file
Type: String
Parameter Sets: (All)
Aliases: Blobname, Blob
Required: False
Position: Named
Default value: $Script:AzureStorageContainer
Accept pipeline input: False
Accept wildcard characters: False
Path to the file you want to delete
Type: String
Parameter Sets: Default
Aliases: File
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Type: String
Parameter Sets: Pipeline
Aliases: File
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Instruct the cmdlet to overwrite the file in the container if it already exists
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This parameters disables user-friendly warnings and enables the throwing of exceptions This is less user friendly, but allows catching exceptions in calling scripts
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Tags: Azure, Azure Storage, Config, Configuration, Token, Blob, File, Files, Bacpac, Container Author: Oleksandr Nikolaiev (@onikolaiev)
The cmdlet supports piping and can be used in advanced scenarios. See more on github and the wiki pages.