Initial commit
This commit is contained in:
21
BuildTasks/Install.Task.ps1
Normal file
21
BuildTasks/Install.Task.ps1
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
task Install Uninstall, {
|
||||
$version = [version] (Get-Metadata -Path $manifestPath -PropertyName 'ModuleVersion')
|
||||
|
||||
$path = $env:PSModulePath.Split(';').Where({
|
||||
$_ -like 'C:\Users\*'
|
||||
}, 'First', 1)
|
||||
|
||||
if ($path -and (Test-Path -Path $path))
|
||||
{
|
||||
"Using [$path] as base path..."
|
||||
$path = Join-Path -Path $path -ChildPath $ModuleName
|
||||
$path = Join-Path -Path $path -ChildPath $version
|
||||
|
||||
"Creating directory at [$path]..."
|
||||
New-Item -Path $path -ItemType 'Directory' -Force -ErrorAction 'Ignore'
|
||||
|
||||
"Copying items from [$Destination] to [$path]..."
|
||||
Copy-Item -Path "$Destination\*" -Destination $path -Recurse -Force
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user