'Get-AzDataShare' is not recognized

27617268 20 Reputation points
2024-07-12T16:42:37.3766667+00:00

Hello,

I was trying to get details of my existing shares on my account and using the sample code from https://learn.microsoft.com/en-us/azure/data-share/samples-powershell

I get the following error,

Get-AzDataShare : The term 'Get-AzDataShare' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Upgraded to lates Azure cli 2.62. I am able to use other Get-Az commands without issues.

Appreciate any help on this

Azure Data Share
Azure Data Share
An Azure service that is used to share data from multiple sources with other organizations.
55 questions
0 comments No comments
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 90,221 Reputation points Microsoft Employee
    2024-07-15T03:09:42.74+00:00

    @27617268 - Thanks for the question and using MS Q&A platform.

    It seems that the 'Az.DataShare' module is not installed on your machine. You can install it by running the following command in PowerShell: https://www.powershellgallery.com/packages/Az.DataShare/1.0.2

    Install-Module -Name Az.DataShare
    

    Then you should be able to use the 'Get-AzDataShare' cmdlet to get details of your existing shares.

    Get-AzDataShare -ResourceGroupName "ADS" -AccountName "WikiAdsAccount" -Name "AdsShare"
    

    User's image

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. TP 97,996 Reputation points
    2024-07-12T17:16:28.6466667+00:00

    Hi,

    Please make sure you have the latest Azure PowerShell installed on your machine.

    How to install Azure PowerShell

    https://learn.microsoft.com/en-us/powershell/azure/install-azure-powershell?view=azps-12.1.0

    Once you have it installed, please open a new Windows PowerShell window and test again.

    Alternatively, you may use Azure Cloud Shell using link below:

    https://shell.azure.com

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.