How can I install the SQL Server PowerShell module on an offline machine?
PowerShell has a built-in mechanism for this which should be easier than the previous answer.

From an Internet-connected computer, run Save-Module sqlserver -path c:\tmp (substitute whatever path you want for the module to be saved to). This will save the module to a directory of the same name in c:\tmp (c:\tmp\SqlServer).

Then, copy that whole directory to your target computer(s). You have a couple options for the destination, depending upon how you want to make it available to users. On PowerShell 5.1 and older look at the paths in the PSModulePath environment variable. On my system, I have:

&gt; $env:psmodulepath.split(";")
C:\Users\MYNAME\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
C:\Program Files\Intel\Wired Networking\
C:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules\


To make the module available to all users, I'd put it in C:\Program Files\WindowsPowerShell\Modules. For just myself, it'll go into C:\Users\MYNAME\Documents\WindowsPowerShell\Modules

These paths may be a bit different if you're running PowerShell Core or PowerShell 7; you'd look at one or more of the paths in $PSGetPath.

From here, you should be able to run Import-Module sqlserver successfully.

Shameless plug: If you're doing a lot of SQL Server administration via PowerShell (and I heartily encourage it!), you should be checking out the dbatools module.