-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
psrepository fails after initial corrective action #32
Comments
was there a fix for this? |
@bishopbm1 or @gsperry2011 can you guys look into this? i don't have Windows anymore to check it out. |
I will provide a lot of information: I am on windows2016 server core: My error is:
This only happens on a handful of nodes, so it is not consistent. Contents of PSRepositories.xml in the c$\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Collections.Hashtable</T>
<T>System.Object</T>
</TN>
<DCT>
<En>
<S N="Key">psgallery-virtual</S>
<Obj N="Value" RefId="1">
<TN RefId="1">
<T>Microsoft.PowerShell.Commands.PSRepository</T>
<T>System.Management.Automation.PSCustomObject</T>
<T>System.Object</T>
</TN>
<MS>
<S N="Name">psgallery-virtual</S>
<S N="SourceLocation">https://chocolatey.example.com/chocolatey</S>
<Nil N="PublishLocation" />
<Nil N="ScriptSourceLocation" />
<Nil N="ScriptPublishLocation" />
<B N="Trusted">true</B>
<B N="Registered">true</B>
<S N="InstallationPolicy">Trusted</S>
<S N="PackageManagementProvider">NuGet</S>
<Obj N="ProviderOptions" RefId="2">
<TNRef RefId="0" />
<DCT />
</Obj>
</MS>
</Obj>
</En>
</DCT>
</Obj>
</Objs> psrepository { 'psgallery-virtual':
ensure => present,
source_location => 'https://chocolatey.example.com/chocolatey',
installation_policy => 'trusted',
} sanitized domain names |
What's the output look like if you run this in powershell (please make sure it's "run as administrator"), also please change the
|
unregister-psrepository psgallery-virtual. Rerun:
|
Hello, I added a try - catch on the block "create_command" when it tries to "Register-PSRepository @params" in lib\puppet\provider\psrepository\powershellcore.rb as the error seems to come from the fact that the repository is tried to be re-added if it exists already. Another weird behavior I noticed is that the stdout from the "self.instances_command" block is not returning anything. I found that the repository discovery block "self.instances_command" was not generating any return at first run, seems like it's due to the So far it fixed the issue and seems a better solution than adding a try catch block as stated earlier. cheers |
Hi,
I ran into an issue while checking psrepository after it has been created successfully at first puppet run. We run an offline environment.
Side note:
The NuGet package provider has been installed manually before (copy Microsoft.PackageManagement.NuGetProvider.dll) and can't be checked successfully via pspackageprovider:
Back to topic:
Our used modules:
hiera-config:
Output of puppet run:
The corrective action can be verified successfully in a new PowerShell-session:
Any help is much appreciated :)
Regards,
Norbert
The text was updated successfully, but these errors were encountered: