Instead of depending on OneGet's unsupported, years out of date implementation, use that only to get the up-to-date version of Chocolatey.
Schedule daily update to run as a PSScheduled Job, enforce that it should run elevated and let the implicit credentials used when executing the script authorize the job where the previous script threw an error if there was no local user with the explicitly configured name of "admin".
This method requires PS 5.0 and up but since this script is for Windows 10 that is not a concern.
Tried running the file to install putty and got this:
WARNING: 'putty' matched package 'putty/0.67' from provider: 'Chocolatey', source 'chocolatey'
WARNING: 'Putty' matched package 'Putty/1.0' from provider: 'PowerShellGet', source 'PSGallery'
Install-Package : Unable to install, multiple packages matched 'Putty'. Please specify a single -ProviderName.
Following the surprisingly helpful error message, I added the ProviderName flag to the end of line 36
Testing on my system and all seems fine.
PowerShell's `Install-Module` command can be used to install this
module, therefore the install script is no longer needed. Thanks to
cluberti for notifying me about this.
close#54