This video takes you through the commands to connect to azure from powersell then authenticate and then to delete folders and files in ADL.
Edit:
Device Authentication line is optional. Code works without auth too.
(#Connect-AzAccount -UseDeviceAuthentication)
My code:
Connect-AzAccount -UseDeviceAuthentication
$ctx = New-AzStorageContext -StorageAccountName 'storageacctname' -StorageAccountKey "storageacctkey"
Remove-AzDataLakeGen2Item -Context $ctx -FileSystem "democontainer" -Path "/testdel/test1/file1.txt" -force
Remove-AzDataLakeGen2Item -Context $ctx -FileSystem "democontainer" -Path "/testdel/test2" -force
Code to bypass manual authentication:
--not working for personal act
$User = "[email protected]"
$PWord = ConvertTo-SecureString -String "pw" -AsPlainText -Force
$tenant = "f3b93d17-dbdb-4364-b467-3a6c92eejjjj"
$subscription = "80117b4b-kkkk-8888-a5c1-2c44f40ccce4"
$Credential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User,$PWord