I have a script with this line that’s executed by Invoke-command:
if ((Get-Module -Name AudioDeviceCmdlets -ea 0) -eq $null) { Install-Module -Name AudioDeviceCmdlets -Force -Confirm:$false; Import-Module -Name AudioDeviceCmdlets -ea 0 }
It’s part of a check to see that the target has the necessaries before using the AudioDeviceCmdlets module. But it gets this prompt, and I can’t find a scripted way around it. Any ideas?
NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program
Files\PackageManagement\ProviderAssemblies' or 'C:\Users\jmwright\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider
-Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the NuGet provider now?
[Y] Yes [N] No [?] Help (default is "Y"):
FWIW, I tried running this command first but it didn’t help: if (! (Get-PackageProvider -name NuGet)) { Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force }
--
John Wright
IT Support Specialist
![]()
1800 Old Bluegrass Avenue, Louisville, KY 40215
Please submit IT requests to Hazelwoo...@bluegrass.org
24 Hour Helpline 1.800.928.8000
CONFIDENTIALITY NOTICE: This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
Installing and then importing the nuget package provider should work.
Do you get a different error?
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/ntpowershell/SN7PR12MB671432EAAB6E197FF2C6FAC991C7A%40SN7PR12MB6714.namprd12.prod.outlook.com.
No, not an error. But I get another install prompt that I can’t get around. lol
--
John Wright
IT Support Specialist
![]()
1800 Old Bluegrass Avenue, Louisville, KY 40215
Please submit IT requests to Hazelwoo...@bluegrass.org
24 Hour Helpline 1.800.928.8000
CONFIDENTIALITY NOTICE: This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
From: ntpowe...@googlegroups.com <ntpowe...@googlegroups.com> On Behalf Of Michael B. Smith
Sent: Monday, November 3, 2025 3:00 PM
To: ntpowe...@googlegroups.com
Subject: [ntpowershell] RE: Command fails on remote PC because of Nuget provider prompt
|
EXTERNAL EMAIL - This email was sent by a person from outside your organization. Exercise caution when clicking links, opening attachments or taking further action, before validating its authenticity. |
Installing and then importing the nuget package provider should work.
Do you get a different error?
From:
ntpowe...@googlegroups.com <ntpowe...@googlegroups.com>
On Behalf Of Wright, John M
Sent: Monday, November 3, 2025 2:56 PM
To: ntpowe...@googlegroups.com
Subject: [ntpowershell] Command fails on remote PC because of Nuget provider prompt
I have a script with this line that’s executed by Invoke-command:
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/ntpowershell/SN7PR12MB671432EAAB6E197FF2C6FAC991C7A%40SN7PR12MB6714.namprd12.prod.outlook.com.
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ntpowershell/5c5e1014b0bc4f28af88df9a47366bef%40smithcons.com.
Here it is:
if (! (Get-PackageProvider -name NuGet)) { Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Confirm:$false }
The provider 'nuget v2.8.5.208' is not installed.
nuget may be manually downloaded from https://cdn.oneget.org/providers/Microsoft.PackageManagement.NuGetProvider-2.8.5.208.dll and installed.
Would you like PackageManagement to automatically download and install 'nuget' now?
[Y] Yes [N] No [?] Help (default is "Y"):
--
John Wright
IT Support Specialist
![]()
1800 Old Bluegrass Avenue, Louisville, KY 40215
Please submit IT requests to Hazelwoo...@bluegrass.org
24 Hour Helpline 1.800.928.8000
CONFIDENTIALITY NOTICE: This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
Pretty sure you need to add one more argument:
if (! (Get-PackageProvider -name NuGet)) { Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Confirm:$false -ForceBootStrap }
Let me know.
Unfortunately, it still prompts:
if (! (Get-PackageProvider -name NuGet)) { Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Confirm:$false -ForceBootStrap }
The provider 'nuget v2.8.5.208' is not installed.
nuget may be manually downloaded from https://cdn.oneget.org/providers/Microsoft.PackageManagement.NuGetProvider-2.8.5.208.dll and installed.
Would you like PackageManagement to automatically download and install 'nuget' now?
[Y] Yes [N] No [?] Help (default is "Y"):
--
John Wright
IT Support Specialist
![]()
1800 Old Bluegrass Avenue, Louisville, KY 40215
Please submit IT requests to Hazelwoo...@bluegrass.org
24 Hour Helpline 1.800.928.8000
CONFIDENTIALITY NOTICE: This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
From: ntpowe...@googlegroups.com <ntpowe...@googlegroups.com>
On Behalf Of Michael B. Smith
Sent: Monday, November 3, 2025 3:09 PM
To: ntpowe...@googlegroups.com
Subject: [ntpowershell] RE: Command fails on remote PC because of Nuget provider prompt
|
This is the first time you received an email from this sender (mic...@smithcons.com). Exercise caution when clicking links, opening attachments or taking further action, before validating its authenticity. |
Pretty sure you need to add one more argument:
if (! (Get-PackageProvider -name NuGet)) { Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Confirm:$false -ForceBootStrap }
Let me know.
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ntpowershell/dcc35ae1fccb49fba2ba77c7fb156107%40smithcons.com.
Is the script running with admin privs?
I just spun up a VM to test, but it’ll take 15-20 minutes to apply updates.
| This is the first time you received an email from this sender (mic...@smithcons.com). Exercise caution when clicking links, opening attachments or taking further action, before validating its authenticity. |
| Secured by Check Point |
Is the script running with admin privs?
I just spun up a VM to test, but it’ll take 15-20 minutes to apply updates.
Stupid silly inconsistency. A Get-* cmdlet is NEVER supposed to modify system state.
This does the bootstrap:
Get-PackageProvider -Name NuGet -Force -ForceBootstrap
That was it! Thanks very much for your help. I would’ve been a long time figuring that one out.
--
John Wright
IT Support Specialist
![]()
1800 Old Bluegrass Avenue, Louisville, KY 40215
Please submit IT requests to Hazelwoo...@bluegrass.org
24 Hour Helpline 1.800.928.8000
CONFIDENTIALITY NOTICE: This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
From: ntpowe...@googlegroups.com <ntpowe...@googlegroups.com>
On Behalf Of Michael B. Smith
Sent: Monday, November 3, 2025 4:46 PM
To: ntpowe...@googlegroups.com
Subject: [ntpowershell] RE: Command fails on remote PC because of Nuget provider prompt
|
This is the first time you received an email from this sender (mic...@smithcons.com). Exercise caution when clicking links, opening attachments or taking further action, before validating its authenticity. |
Stupid silly inconsistency. A Get-* cmdlet is NEVER supposed to modify system state.
This does the bootstrap:
Get-PackageProvider -Name NuGet -Force -ForceBootstrap
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ntpowershell/68de22ee4f684200a4157f823a4c9db8%40smithcons.com.