This commit is contained in:
2020-08-30 23:05:07 -04:00
parent 82adef14b5
commit e38f9bd599
18 changed files with 272 additions and 188 deletions
+32
View File
@@ -0,0 +1,32 @@
#Requires -Version 2.0
param(
[string]$Type='management-scripts',
[string]$Name,
[string]$Arguments)
## Get rid of null arguments
If ( $Arguments -eq "null" ) { $Arguments = $null }
## Make sure $Name and $Type are defined
If ( $Name -and $Type )
{
## Form the URL to the specified script
$URL = "https://dev.emberkom.com/emberkom/${Type}/raw/branch/master/${Name}.ps1"
## Get the script
Write-Output "Retrieving : ${Name}.ps1"
Try { $Script = (New-Object Net.WebClient).DownloadString($URL) }
Catch { Write-Output $_.Exception.Message }
## Make a script block
Try { $ScriptBlock = [Scriptblock]::Create($Script) }
Catch { Write-Output $_.Exception.Message }
## Run the script any any arguments
Write-Output "Executing: ${Name}.ps1 ${Arguments}"
Try { Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments }
Catch { Write-Output $_.Exception.Message }
}
Else { Write-Output "No script or type was specified" }