0

I'm running powershell command on a linux server, and I have powershell for linux as well as the SqlServer installed, but when I run Invoke-ASCmd I got

Invoke-ASCmd: The term 'Invoke-ASCmd' is not recognized as a name of a cmdlet, function, script file, or executable program.

Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Here are the version of my powershell and SqlServer module:

PS /> Get-Host | Select-Object Version

Version
-------
7.1.3

PS /> Get-Module -Name SqlServer

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     21.1.18245            SqlServer                           {Add-SqlAvailabilityDatabase, Add-SqlAvailabilityGroupListenerStaticIp, Add-SqlColumnEncryptionKeyValue, Add-SqlLogin…}

I could run Invoke-ASCmd locally on Windows, but it doesn't work on Linux. Please help me with this issue, thanks so much

Nelson
  • 1
  • Here is my powershell version PS /> $PSVersionTable Name Value ---- ----- PSVersion 7.1.3 PSEdition Core GitCommitId 7.1.3 OS Linux 5.4.0-1047-azure #49~18.04.1-Ubuntu SMP Thu Apr 22 21:28:54 UTC 2021 Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 – Nelson Jun 28 '21 at 03:34
  • 1
    "Note: This cmdlet is only available for PowerShell 5. Currently, it is available for PowerShell 7 in recent **preview** versions of the module." https://learn.microsoft.com/en-us/powershell/module/sqlserver/invoke-ascmd?view=sqlserver-ps#description – Daniel Jun 28 '21 at 03:35

0 Answers0