Hi all
Im having difficulty passing powershell variables into Puppet, while using
the Powershell module.
What I need to achieve is this in powershell. It is basically a script that
executes a check to see if a windows module is installed, and if not,
copies it from a source directory.
*This is the powershell script*
$check = Get-WindowsFeature -name Net-Framework-Core
$source = "\\server\directory\directory2\directory3"
$destination = "C:\source3"
if ($check.Installed -ne "True") {
Copy-Item $source -Destination $destination -Recurse
Install-WindowsFeature Net-Framework-Core
Remove-Item $destination -Recurse
}
*This is my puppet manifest*
class profiles::dotnetrun {
$check = "Get-WindowsFeature -name Net-Framework-Core"
$source = "\\\\server\\directory\\directory2\\directory3"
$destination = "C:\source3"
exec { 'dotnet':
command => 'Copy-Item \$source -Destination \$destination -Recurse',
onlyif => '\$check.Installed -ne "True"',
provider => powershell,
}
}
--
<http://www.itv.com>
ITV plc (Registration No. 4967001) (ITV) is incorporated in England and
Wales with its registered office at The London Television Centre, Upper
Ground, London SE1 9LT. Please visit www.itv.com for further information.
This email and any attachments are intended solely for the addressee and
may contain confidential, copyrighted and/or privileged information. If
you have received this message in error, please notify us and delete it.
Recipients should scan the email and any attachments for their own
protection.
This email does not conclude a binding agreement. The views or opinions
presented in this email do not necessarily represent those of ITV.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/5672654e-6c18-4fdd-a2c7-d4c62cba1a03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.