In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The default instance of SQL Server 2014 and the named instance SQL2017 of SQL Server 2017 are installed on the server
$env:PSModulePath is
% SystemRoot%\ system32\ WindowsPowerShell\ v1.0\ Modules\; C:\ Program Files (x86)\ Microsoft SQL Server\ 120\ Tools\ PowerShell\ Modules\; C:\ Program Files (x86)\ Microsoft SQL Server\ 140\ Tools\ PowerShell\ Modules\
Executing the Powershell command
New-SqlAvailabilityGroup-Name $AgName-InputObject $Primary-AvailabilityReplica $Replicas-Database $DatabaseList
The error is as follows:
The SQLPS directory path of SQL Server 2014 has been removed
% SystemRoot%\ system32\ WindowsPowerShell\ v1.0\ Modules\; C:\ Program Files (x86)\ Microsoft SQL Server\ 140\ Tools\ PowerShell\ Modules\
Then load the default SQLPS of SQL Server 2017, and execute New-SqlAvailabilityGroup normally.
This indicates that the parameter-InputObject type corresponding to New-SqlAvailabilityGroup in the two versions of SQLPS is different.
Postscript:
A later attempt to load the SQLPS module of SQL Server 2014 failed to create an AG for the default instance of SQL Server 2014. Simply call the newly installed SqlServer module directly, which is backwards compatible.
Powershell module installation
# https://www.powershellgallery.com
# download and install online
Install-Module-Name Powershellget-force
# offline download and installation
# https://www.powershellgallery.com/packages/CredentialsManager/1.1
# Save module
Save-Module-Name CredentialsManager-Path C:\ powershellgallery
# copy to
% ProgramFiles%/WindowsPowershell/Module/
# load ready-to-use, use-time registration
Import-Module-Name CredentialsManager
PowerShell 2.0 uses the appropriately-named Import-Module cmdlet to import modules. When this cmdlet is run, Windows PowerShell searches for the specified module within the directories specified in the PSModulePath variable. When the specified directory is found, Windows PowerShell searches for files in the following order: module manifest files (.psd1), script module files (.psm1), binary module files (.dll). For more information about adding directories to the search, see Modifying the PSModulePath Installation Path.
Beginning in Windows PowerShell 3.0, modules are imported automatically when any cmdlet or function in the module is used in a command. This feature works on any module in a directory that this included in the value of the PSModulePath environment variable. If you do not save your module on a valid path however, you can still load them using the explicit Import-Module option, described above.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.