Environment:
Windows 2016 Server Standard
PowerShell 5
Has Internet connection
Running PowerShell as administrator
JFrog is something new we're implementing but not sure if fully on server or not. I know very little about it.
When I try to run the following:
Install-Module -Name SqlServer
I get following prompt:
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories
I answer yes to the prompt and get the following error:
WARNING: Unable to download from URI
'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check
your internet connection. PackageManagement\Install-PackageProvider :
No match was found for the specified search criteria for the provider
'NuGet'. The package provider requires 'PackageManagement' and
'Provider' tags. Please check if the specified package has the tags.
WARNING: Unable to download from URI
'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check
your internet connection. PackageManagement\Get-PackageProvider :
Unable to find package provider 'NuGet'. It may not be imported yet.
Try 'Get-PackageProvider
-ListAvailable'.
What is going on?
I tried:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Get-PackageProvider -Name Nuget -Force
I got the following:
Get-PackageProvider -Name nuget -Force WARNING: MSG:UnableToDownload
«go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409» «» WARNING:
Unable to download the list of available providers. Check your
internet connection. WARNING: Unable to download from URI
'go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
Get-PackageProvider : Unable to find package provider 'nuget'. It may
not be imported yet. Try 'Get-PackageProvider -ListAvailable
Update
PS C:\Windows\system32> Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
WARNING: MSG:UnableToDownload
«https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409» «»
WARNING: Unable to download the list of available providers. Check
your internet connection. WARNING: Unable to download from URI
'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
Install-PackageProvider : No match was found for the specified search
criteria for the provider 'NuGet'. The package provider requires
'PackageManagement' and 'Provider' tags. Please check if the specified
package has the tags. At line:1 char:1
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
+ CategoryInfo : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider)
[Install-PackageProvider], Excepti on
+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider
PS C:\Windows\sy
Update 2:
Update 3:
Related
I have a .NetFramework4.61 WebAPI. I am trying install IdentityServer3.AccessTokenValidation & System.IdentityModel.Tokens.Jwt using Nuget but it is giving me the below error. I also try to install using package manager console that too also failed
>Install-Package IdentityServer3.AccessTokenValidation -Version 2.14.0
>Install-Package System.IdentityModel.Tokens.Jwt -Version 6.11.0
How to resolve this issue?
Severity Code Description Project File Line Suppression State
Error Exception 'System.AggregateException' thrown when trying to add source 'http://172.16.20.241:11688/codeengines/nuget/'. Please verify all your online package sources are available.
One or more errors occurred.
Unable to load the service index for source http://172.16.20.241:11688/codeengines/nuget/.
An error occurred while sending the request.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 172.16.20.241:11688
This seems to be lack of nuget source issue and you need to add the nuget source for nuget.org and then try to install the package
Add a nuget source point to https://api.nuget.org/v3/index.json on visual studio
Install the package again. You can select the package source on package management console on visual studio or specify it in the command as bellow:
PS> Install-Package IdentityServer3.AccessTokenValidation -Version 2.14.0 -Source nuget.org
Trying to Import SQL Server module to use Invoke-Sqlcmd and whether in raw PowerShell ISE (as Administrator and non-Admin) or via SSMS I get the same error and wondering if someone could help please?
The version I am using is an unzipped nupkg of sqlserver.21.1.18230 (the latest release) and the DLL's are in the right location (C:\Program Files\WindowsPowerShell\Modules). The DLL's are not showing as Blocked in the Properties. Security is showing "Full Control" on the DLL in the Properties.
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version,Release -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSChildName, Version, Release
##Get PowerShell version
$PSVersionTable
$Env:PSModulePath
#Get-PSRepository
Get-ExecutionPolicy -List
[Environment]::Is64BitProcess
Import-Module SqlServer
The Import-Module is failing with the following results (after the error a raft of other DLL's from the SqlServer.psm1 script are listed also erroring)
PSChildName Version Release
----------- ------- -------
v2.0.50727 2.0.50727.4927
v3.0 3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation 3.0.6920.4902
v3.5 3.5.30729.4926
Client 4.8.03752 528040
Full 4.8.03752 528040
Client 4.0.0.0
C:\Users\app-itsme\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\windows\system32\WindowsPowerShell\v1.0\Modules
Import-Module : Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\SqlServer\Microsoft.SqlServer.Management.PSSnapins.dll' or one of its dependencies. Operation is not
supported. (Exception from HRESULT: 0x80131515)
At C:\Program Files\WindowsPowerShell\Modules\SqlServer\SqlServer.psm1:61 char:25
+ ... $binaryModule = Import-Module -Name $binaryModulePath -PassThru
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], FileLoadException
+ FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
The variable '$binaryModule' cannot be retrieved because it has not been set.
At C:\Program Files\WindowsPowerShell\Modules\SqlServer\SqlServer.psm1:63 char:29
+ $importedModules += $binaryModule
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (binaryModule:String) [], RuntimeException
+ FullyQualifiedErrorId : VariableIsUndefined
Any help appreciated
Thank you
The issue was still around permissions and installation. Installation seemed to have to be at non-admin and then Install-Module at non-admin. It was then available as admin.
Also the Powershell admin doesnt have internet access something that Powershell assumes always exists which added to the woes of other solutions being attempted. Had to set proxy firewall etc
Thanks
The problem
I am trying to install a .net core 3.1 wpf app onto a windows 2019 server using msix as the method of deployment. The windows server is up to date and should support msix, but will not install any msix package I create using the powershell command Add-AppPackage.
The packages will install on windows 10 machines if you click on the .appinstaller file and use the gui, but they will not install on the same machine if you use powershell.
What I have tried
I've went through this troubleshooting page to no avail.
I have tried different msix packages
I have tried using a local file directory
I have tried running as administrator
Code
This is an example of what I am trying to install:
Running the .appinstaller file will correctly install this uwp app.
However, this will not work:
Add-AppPackage .\TestUwp.appinstaller
Error Message
This is the error message the powershell script outputs:
Add-AppPackage : Deployment failed with HRESULT: 0x80073CF0, Package could not be opened.
error 0x8007000D: Opening the package from location TestUwp.appinstaller failed.
NOTE: For additional information, look for [ActivityId] 742e8080-11e2-0000-5f0b-3374e211d601 in the
Event Log or use the command line Get-AppPackageLog -ActivityID 742e8080-11e2-0000-5f0b-3374e211d601
At line:1 char:1
+ Add-AppPackage .\TestUwp.appinstaller
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (W:\...\.appinstaller:String) [Add-AppxPackage],
FileNotFoundException
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPac
kageCommand
PS W:\[file location here]> Get-AppPackageLog -ActivityID 742e8080-11e2-0000-5f0b-3374e211d601
Time ID Message
---- -- -------
4/14/2020 9:17:50 AM 603 Started deployment Add operation on a package with main
parameter TestUwp.appinstaller and Options 0 and 0. See
http://go.microsoft.com/fwlink/?LinkId=235160 for help
diagnosing app deployment issues.
4/14/2020 9:17:50 AM 465 error 0x8007000D: Opening the package from location
TestUwp.appinstaller failed.
4/14/2020 9:17:50 AM 403 error 0x8007000D: Failure to get staging session for:
file:///W:/[file location here]/TestUwp.appinstaller.
4/14/2020 9:17:50 AM 404 AppX Deployment operation failed for package with error
0x80073CF0. The specific error text for this failure is: error
0x8007000D: Opening the package from location
TestUwp.appinstaller failed.
When you use:
Add-AppxPackage .\TestUwp.appinstaller
The path will be mapped to the positional parameter -Path. This parameter is designed to specify the path to the app package. But you are not installing the app directly. You are using an app installer file. To install from that, use:
Add-AppxPackage -AppInstallerFile .\TestUwp.appinstaller
With this command, I was able to install your package successfully.
I am having trouble doing an import-module ActiveDirectory on a Server 2008 SP2 (64 bit).
NET Framework 3.5 SP1 is installed
I download the Windows6.0-KB968934-x86.msu (for ADWS)
This file did not install saying that "The update does not apply to my system"
Doing some research (http://anti-american.rssing.com/chan-2091246/all_p15.html) I installed hotfix in KB article 969166 and the above update installed.
After a reboot, I noticed that in services, Active Directory Web Services is running
I opened an administrative PS prompt and performed an Import-Module ActiveDirectory, but...
...I get:
Import-Module : The specified module 'activedirectory' was not loaded because no valid module file was found in any module directory.
At line:1 char:14
+ import-module <<<< activedirectory
+ CategoryInfo : ResourceUnavailable: (activedirectory:String) [Import- Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
If its any help, here's some info in PSModule Path, modules and the version:
PS C:\Windows\system32> $env:PSModulePath
C:\Users\ischmd\Documents\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PS C:\Windows\system32> Get-Module -ListAvailable
ModuleType Name ExportedCommands
---------- ---- ----------------
Manifest BitsTransfer {}
Manifest PSDiagnostics {}
PS C:\Windows\system32> $PSVersionTable.psversion
Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1
PS C:\Windows\system32> $host.version
Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1
Any help is greatly appreciated. The main purpose of this is to GET-AdUser command to automate some process but at this point, were stumped. My only conclusion is that this is not possible with Windows 2008 SP2...
AD Powershell module should be listed under installed Features. See image:
.
For non-servers this requires Remote Server Administration Tools for Windows __
Windows 7: http://www.microsoft.com/en-us/download/details.aspx?id=7887
Windows 8: http://www.microsoft.com/en-us/download/details.aspx?id=28972
Windows 10: https://www.microsoft.com/en-au/download/details.aspx?id=45520
The ActiveDirectory module for powershell can be installed by adding the RSAT-AD-Powershell feature.
In an elevated powershell window:
Add-WindowsFeature RSAT-AD-PowerShell
or
Enable-WindowsOptionalFeature -FeatureName ActiveDirectory-Powershell -Online -All
You can install the Active Directory snap-in with Powershell on Windows Server 2012 using the following command:
Install-windowsfeature -name AD-Domain-Services –IncludeManagementTools
This helped me when I had problems with the Features screen due to AppFabric and Windows Update errors.
Even better use implicit remoting to use a module from another Machine!
$s = New-PSSession Server-Name
Invoke-Command -Session $s -ScriptBlock {Import-Module ActiveDirectory}
Import-PSSession -Session $s -Module ActiveDirectory -Prefix REM
This will allow you to use the module off a remote PC for as long as the PSSession is connected.
More Information:
https://technet.microsoft.com/en-us/library/ff720181.aspx
On Windows 10 - This happened for me after the latest update in 2020.
What solved this issue for me was running the following in PowerShell
C:\>Install-Module -Name MicrosoftPowerBIMgmt
This may be an old post, but if anyone is still facing this issue after trying all the above mentioned steps, ensure whether the default path of PowerShell module is specified under the PSModulePath environment variable.
The default path should be %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\
If you don't have the Active Directory module installed on your machine, you need to download the correct Remote Server Administration Tools (RSAT) package for your OS.
https://learn.microsoft.com/en-US/troubleshoot/windows-server/system-management-components/remote-server-administration-tools#rsat-for-windows-10-platform-and-tools-support-matrix
If you are running windows 10 you can download Remote Server Administration Tools for Windows 10 update from here https://www.microsoft.com/en-us/download/details.aspx?id=45520
Once installed run 'import-module ActiveDirectory' using elevated PowerShell.
I'm trying to implement a backup management script i found at http://sev17.com/2011/03/restore-and-relocate-database-files-using-powershell/
The article says it depends on SQLPSX version 2.3.2.1 or higher - I have the most current version.
attempting to execute this line:
$server = get-sqlserver $sqlserver
results in:
New-Object : Cannot find type [Microsoft.SqlServer.Management.Common.ServerConnection]: make sure the assembly containing this type is loaded.
At C:\Users\...\Documents\WindowsPowerShell\Modules\sqlserver\SQLServer.psm1:68 char:24
+ { $con = new-object <<<< ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver }
result of get-module -listAvailable
ModuleType Name ExportedCommands
---------- ---- ----------------
Script adoLib {}
Manifest Agent {Get-AgentTargetServerGroup, Get-AgentProxyAccount, Get-AgentJobSchedule...
Script ISECreamBasic {}
Script mySQLLib {}
Script OracleClient {}
Script OracleIse {}
Script PBM {}
Script PerfCounters {}
Manifest Pscx {}
Manifest Repl {Get-ReplEnumSubscriptions2, Get-ReplPublisherMonitor, Get-ReplEnumPubli...
Manifest ShowMbrs {Get-ShowMbrs, Set-ShowMbrs, New-ShowMbrs, Get-GroupUser}
Script SQLIse {}
Manifest SQLMaint {Get-SqlIndexFragmentation, New-UserMember, Invoke-SqlIndexRebuild, Get-...
Manifest SQLParser {Test-SqlScript, Out-SqlScript}
Script SQLProfiler {}
Script SQLPSX {}
Manifest sqlserver {Get-SqlScripter, Get-SqlIndexFragmentation, Remove-SqlServerRoleMember,...
Manifest SSIS {New-ISItem, Get-ISPackage, Get-ISItem, Copy-ISItemFileToSQL...}
Manifest WPK {}
Manifest AppLocker {}
Manifest BitsTransfer {}
Manifest PSDiagnostics {}
Manifest TroubleshootingPack {}
Manifest WebAdministration {}
RE: SMO
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended")
results:
True v2.0.50727 C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.ConnectionInfo\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ConnectionInfo.dll
True v2.0.50727 C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Smo.dll
True v2.0.50727 C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.SmoExtended\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.SmoExtended.dll
New-Object : Cannot find type [Microsoft.SqlServer.Management.Common.ServerConnection]: make sure the assembly containing this type is loaded.
Make sure the Assembly containing the Microsoft.SqlServer.Management.Common.ServerConnection type (which I think is Microsoft.SqlServer.ConnectionInfo) is loaded first:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo")
For me works with
Import-Module -Name SqlServer
It could stay in script
NOTE:
Windows Server 2016
Before I have installed
Install-Module -Name SqlServer
With [Reflection.Assembly]::LoadWithPartialName works only on windows 10 for me.
I realize this is just about the worst answer ever but...
Seems like there might be something wrong with your SMO or something. You could try loading SP3 for SQL 2008 or just try re-installing SSMS 2008. Installing the 2008 R2 version of SSMS could be an option as well.
Again, not the greatest answer in the world but might be worth trying.
The powershell components are only installed if you have powershell 2.0 installed at the time of SSMS setup. Powershell is normally already setup on the machine unless you are using Windows Server 2008. Ensure that powershell 2.0 is installed before installing SSMS.
$sc = New-Object Microsoft.SqlServer.Management.Common.ServerConnection
Error:
New-Object : Cannot find type [Microsoft.SqlServer.Management.Common.ServerConnection]: verify that the assembly containing this type is loaded
For this issue ,
Please Ensure micro soft sqlserver management object 2012(x64)is installed.
and go ahead check the dll files if present in given path "C:\Program Files\Microsoft SQL Server\110\SDK\Assemblies"