Skip to content

Commit

Permalink
Trying IWR deployment and organizing deployment types
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoColomb0 committed Dec 8, 2023
1 parent fdbe25f commit 7bf9b5e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
41 changes: 41 additions & 0 deletions AzurePSDeployer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<#
.INFO
Script Name: AzurePSDeployer.ps1
Description: Automatic Azure infrastructure deployer (Main script)
.NOTES
File Name : windowsclient.ps1
Author : MarcoColomb0
Prerequisite : PowerShell, Az module and an Azure subscription :)
Description : This serves as the 'launcher' for all deployments located in the subdirectory '/deployments,' which can be initiated directly by cloning or downloading the source code.
#>

param (
[string]$Deploy
)

function Invoke-DeploymentScript {
param (
[string]$ScriptName
)

$GitHubRepo = "https://github.com/MarcoColomb0/AzurePSDeployer"
$ScriptPath = "deployments/$ScriptName.ps1"
$ScriptURL = "$GitHubRepo/raw/main/$ScriptPath"

$ScriptContent = Invoke-WebRequest -Uri $ScriptURL -UseBasicParsing

if ($ScriptContent.StatusCode -eq 200) {
Invoke-Expression $ScriptContent.Content
} else {
Write-Host "Unable to find $ScriptName on the GitHub repository."
}
}

# List of arguments to execute a specific deployment type
switch ($Deploy) {
"WindowsClient" { Invoke-DeploymentScript -ScriptName "WindowsClient" }
"UbuntuServer" { Invoke-DeploymentScript -ScriptName "UbuntuServer" }
"WindowsServer" { Invoke-DeploymentScript -ScriptName "WindowsServer" }
default { Write-Host "Invalid option. Use -Deploy with WindowsClient, UbuntuServer, or WindowsServer." }
}
4 changes: 2 additions & 2 deletions WindowsClient.ps1 → deployments/windowsclient.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<#
.INFO
Script Name: WindowsClient.ps1
Script Name: windowsclient.ps1
Description: Automatic Azure infrastructure deployer (Windows Client)
.NOTES
File Name : WindowsClient.ps1
File Name : windowsclient.ps1
Author : MarcoColomb0
Prerequisite : PowerShell, Az module and an Azure subscription :)
#>
Expand Down

0 comments on commit 7bf9b5e

Please sign in to comment.