Hi @Wu, Jack ,
It is likely prompting you because the PSGallery repository is unstrusted.
install-module sqlserver -Repository PSGallery
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
As the module says, look at running Set-PSRepository first to trust the PSGallery repository
Set-PSRepository -?
NAME
Set-PSRepository
SYNTAX
Set-PSRepository [-Name] <string> [[-SourceLocation] <uri>] [-PublishLocation <uri>] [-ScriptSourceLocation <uri>]
[-ScriptPublishLocation <uri>] [-Credential <pscredential>] [-InstallationPolicy {Trusted | Untrusted}] [-Proxy
<uri>] [-ProxyCredential <pscredential>] [-PackageManagementProvider <string>] [<CommonParameters>]
Hope this helps.
Please accept as answer and upvote if the above information is helpful for the benefit of the community.