Add-Type -Path c:\AzureStorageFile\Microsoft.WindowsAzure.Storage.dll
$AzStorObject = New-Object -TypeName Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext
Gives me error
New-Object: A constructor was not found. Cannot find an appropriate constructor for typeMicrosoft.WindowsAzure.Commands.Storage.AzureStorageContext.
You are not passing the
-ArgumentListparameter toNew-Object, so when attempting to instantiate the specified type it will look for a constructor that takes no parameters. The parameterless constructor of theAzureStorageContextclass isprotected, notpublic, though......so
New-Objectwill not be able to invoke it.That same
Microsoft.WindowsAzure.Storage.dllassembly is used by theAzure.Storagepackage. Upon installing that......you can invoke the
New-AzureStorageContextcmdlet to createAzureStorageContextinstances...Otherwise, there is a
publicconstructor of theAzureStorageContextclass......that you could use if you pass a
CloudStorageAccountinstance...