Skip to content

Commit

Permalink
break apart functions
Browse files Browse the repository at this point in the history
  • Loading branch information
krjhitch committed Apr 4, 2017
1 parent d2f46ec commit 939ad90
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
23 changes: 23 additions & 0 deletions functions/Copy-DSCResource.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function Copy-DSCResource {
[cmdletBinding()]
Param($PSSession,$ModulestoCopy)

foreach ($Module in $ModulestoCopy)
{
$Source = 'C:\Program Files\WindowsPowerShell\Modules\'+$Module.ModuleName
Write-Verbose "Module location: $Source"
$Destination = 'C:\Program Files\WindowsPowerShell\Modules\'
try
{
Write-Verbose "Copying"
Copy-Item -ToSession $PSSession -Path $Source -Destination $Destination -Recurse -Force -ErrorAction STOP -Verbose
Write-Verbose "Copied"
}
catch
{
Write-Output $Error[0].Exception
break
}
}

}
27 changes: 0 additions & 27 deletions functions/Get-MOFRequiredModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,3 @@
return $ModulesToCopy

}

function Copy-DSCResource
{
[cmdletBinding()]
Param($PSSession,$ModulestoCopy)

foreach ($Module in $ModulestoCopy)
{
$Source = 'C:\Program Files\WindowsPowerShell\Modules\'+$Module.ModuleName
Write-Verbose "Module location: $Source"
$Destination = 'C:\Program Files\WindowsPowerShell\Modules\'
try
{
Write-Verbose "Copying"
Copy-Item -ToSession $PSSession -Path $Source -Destination $Destination -Recurse -Force -ErrorAction STOP -Verbose
Write-Verbose "Copied"
}
catch
{
Write-Output $Error[0].Exception
break
}
}

}


0 comments on commit 939ad90

Please sign in to comment.