@Michał Pawlicki
Thanks for your patience while we looked into this issue. There is a change on File cmdlets from Az 4.1.0. The change is: the File Share cmdlets output changes from “CloudFileShare” to “AzureStorageFileShare”, the original output will become a child property of the new output. To resolve this you can make a simple change in your foreach loop:
foreach ($Snapshot in $SnapshotList)
{
Remove-AzStorageShare -Share $Snapshot.CloudFileShare -Verbose -Force
}
Hope this helps! Let us know if you have any further questions.
-------------------
Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.