Share via

Which SQL module version of PowerShell has -autorelocate cmdlet available

Aravind PowerShell 1 Reputation point
2022-11-18T23:28:15.28+00:00

I am trying to build a migration script and use the -autorelocate cmdlet to perform restore in the destination sql server.
the -autorelocate cmdlet is missing from the list of cmdlets that appear through intellisense in the restore-sqldatabase syntax.
Would like some assistance on why this cmd is missing and how to get it back through a specific SQL module version.

Windows for business | Windows Server | User experience | PowerShell
SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


3 answers

Sort by: Most helpful
  1. YufeiShao-msft 7,156 Reputation points
    2022-11-21T08:46:09.07+00:00

    Hi @Aravind PowerShell ,

    From the SQL Server cmdlet do not have the cmdlet you said
    https://www.powershellgallery.com/packages/SqlServer/22.0.30-preview

    If you want to relocate, you can see this cmdlet: New-RestoreLocation

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

  2. Rich Matheisen 48,116 Reputation points
    2022-11-19T23:54:06.513+00:00

    The current version of the SQLServer module is 21.1.18256. See here: 21.1.18256

    FYI, the cmdlet is Restore-SqlDatabase. That cmdlet has a parameter named "-AutoRelocateFile".

    Was this answer helpful?

    0 comments No comments

  3. Obaid Farooqi MSFT 786 Reputation points Microsoft Employee Moderator
    2022-11-19T19:07:25.847+00:00

    Hi @Aravind PowerShell
    This tag (openspecs-sqlserver) is dedicated to supporting issues related to open specifications. You can find open specifications here https://learn.microsoft.com/en-us/openspecs/
    I have removed openspecs-sqlserver tag and have added sql-server-general tag, where you have a better chance of getting an answer.

    Regards,
    Obaid Farooqi - MSFT

    Was this answer helpful?

    0 comments No comments

Your answer

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