-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from MG-Cloudflow/dev
v0.2.0-alpha
- Loading branch information
Showing
16 changed files
with
383 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<# | ||
.SYNOPSIS | ||
Handles the click event for the AppConfigButton to load application configuration policies. | ||
.DESCRIPTION | ||
This script is triggered when the AppConfigButton is clicked. It sets the global policy type to mobileAppConfigurations and calls the Load-PolicyData function to load application configuration policies. It includes logging for each major step and error handling. | ||
.NOTES | ||
Author: Maxime Guillemin | CloudFlow | ||
Date: 09/07/2024 | ||
.EXAMPLE | ||
$AppConfigButton.Add_Click({ | ||
# Code to handle click event | ||
}) | ||
#> | ||
|
||
$AppConfigButton.Add_Click({ | ||
Write-IntuneToolkitLog "AppConfigButton clicked" -component "AppConfig-Button" -file "AppConfigButton.ps1" | ||
|
||
try { | ||
$global:CurrentPolicyType = "mobileAppConfigurations" | ||
Write-IntuneToolkitLog "Set CurrentPolicyType to mobileAppConfigurations" -component "AppConfig-Button" -file "AppConfigButton.ps1" | ||
|
||
Load-PolicyData -policyType "mobileAppConfigurations" -loadingMessage "Loading application configurations..." -loadedMessage "Application configurations loaded." | ||
Write-IntuneToolkitLog "Called Load-PolicyData for mobileAppConfigurations" -component "AppConfig-Button" -file "AppConfigButton.ps1" | ||
} catch { | ||
$errorMessage = "Failed to load application configurations. Error: $($_.Exception.Message)" | ||
Write-Error $errorMessage | ||
Write-IntuneToolkitLog $errorMessage -component "AppConfig-Button" -file "AppConfigButton.ps1" | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<# | ||
.SYNOPSIS | ||
Checks the current running version against the latest release version on GitHub. | ||
.DESCRIPTION | ||
This script retrieves the latest release version from GitHub and compares it with the current running version. If a newer version is available, it notifies the user. | ||
.NOTES | ||
Author: Maxime Guillemin | CloudFlow | ||
Date: 09/07/2024 | ||
#> | ||
|
||
function Check-LatestVersion { | ||
param ( | ||
[string]$currentVersion, | ||
[string]$repoUrl = "https://api.github.com/repos/MG-Cloudflow/Intune-Toolkit/releases/latest" | ||
) | ||
|
||
try { | ||
Write-IntuneToolkitLog "Checking for latest version at $repoUrl" -component "Check-LatestVersion" -file "CheckVersion.ps1" | ||
$response = Invoke-RestMethod -Uri $repoUrl -Method Get | ||
$latestVersion = $response.tag_name | ||
|
||
if ($latestVersion -ne $currentVersion) { | ||
$message = "A new version ($latestVersion) is available. You are currently running version $currentVersion. Download the latest Version from github https://github.com/MG-Cloudflow/Intune-Toolkit" | ||
[System.Windows.Forms.MessageBox]::Show($message, "Update Available", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information) | Out-Null | ||
Write-IntuneToolkitLog $message -component "Check-LatestVersion" -file "CheckVersion.ps1" | ||
} else { | ||
Write-IntuneToolkitLog "You are running the latest version ($currentVersion)" -component "Check-LatestVersion" -file "CheckVersion.ps1" | ||
} | ||
} catch { | ||
$errorMessage = "Failed to check for the latest version. Error: $($_.Exception.Message)" | ||
Write-Error $errorMessage | ||
Write-IntuneToolkitLog $errorMessage -component "Check-LatestVersion" -file "CheckVersion.ps1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.