Skip to content

Commit 3488325

Browse files
moved configs
1 parent e0d91a3 commit 3488325

File tree

5 files changed

+197
-189
lines changed

5 files changed

+197
-189
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/Assembly
2-
/Modules
3-
/Utilities
1+
Assembly
2+
Modules
3+
Utilities

App/AdminMenu.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ Start-Log -FilePath "$env:LocalAppData\AdminMenu\Logs\$(Get-Date -Format yyyyMMd
161161
## Variables: Script Name and Script Paths
162162
[string]$scriptPath = $MyInvocation.MyCommand.Definition
163163
[string]$scriptName = [IO.Path]::GetFileNameWithoutExtension($scriptPath)
164-
[string]$scriptFileName = Split-Path -Path $scriptPath -Leaf
165164
[string]$scriptRoot = Split-Path -Path $scriptPath -Parent
166165
[string]$invokingScript = (Get-Variable -Name 'MyInvocation').Value.ScriptName
167166

@@ -181,17 +180,17 @@ Else {
181180
[string]$XamlPath = Join-Path -Path $scriptRoot -ChildPath 'Resources'
182181
[string]$ModulesPath = Join-Path -Path $scriptRoot -ChildPath 'Modules'
183182
[string]$UtilPath = Join-Path -Path $scriptRoot -ChildPath 'Utilities'
183+
[string]$ConfigPath = Join-Path -Path $scriptRoot -ChildPath 'Configs'
184+
[string]$MenuScriptsPath = Join-Path -Path $scriptRoot -ChildPath 'Scripts'
184185

185186
# When Using Executable Command Line
186187
If ($ConfigCommandLine){
187188
[string]$ConfigFile = Join-Path -Path $scriptRoot -ChildPath $ConfigCommandLine
188189
}
189190
Else{
190-
[string]$ConfigFile = Join-Path -Path $scriptRoot -ChildPath 'AdminMenu.ps1.config'
191+
[string]$ConfigFile = Join-Path -Path $ConfigPath -ChildPath 'AdminMenu.ps1.config'
191192
}
192-
[string]$NameFile = Join-Path -Path $scriptRoot -ChildPath 'AdminMenu.ps1.names'
193-
194-
[string]$appAuthor = 'Richard Tracy'
193+
[string]$NameFile = Join-Path -Path $ConfigPath -ChildPath 'AdminMenu.prereqs'
195194
#=======================================================
196195
# PARSE CONFIG FILE
197196
#=======================================================
@@ -206,6 +205,7 @@ Else{
206205
[Xml.XmlElement]$xmlMenuOptions = $xmlConfig.Menu_Options
207206
[boolean]$AppOptionRequireAdmin = [boolean]::Parse($xmlMenuOptions.Option_RequireAdmin)
208207
[boolean]$AppOptionRSATCheck = [boolean]::Parse($xmlMenuOptions.Option_RSATCheck)
208+
[boolean]$AppPrereqCheck = [boolean]::Parse($xmlMenuOptions.Option_PrereqCheck)
209209
[boolean]$AppOptionDebugeMode = [boolean]::Parse($xmlMenuOptions.Option_DebugMode)
210210
[string]$AppOptionAccent = $xmlMenuOptions.Option_Accent
211211
[string]$AppOptionTheme = $xmlMenuOptions.Option_Theme
@@ -224,8 +224,8 @@ Else{
224224

225225
#check if remote config will be used and path is accessible
226226
If (($AppUseRemoteConfig) -and (Test-Path $AppRemotePath) -and (!$ForceLocal)){
227-
[string]$remoteConfig = Join-Path -Path $AppRemotePath -ChildPath 'AdminMenu.ps1.config' -ErrorAction SilentlyContinue
228-
[string]$remoteNames = Join-Path -Path $AppRemotePath -ChildPath 'AdminMenu.ps1.names' -ErrorAction SilentlyContinue
227+
[string]$remoteConfig = Join-Path -Path $AppRemotePath -ChildPath '\Configs\AdminMenu.ps1.config' -ErrorAction SilentlyContinue
228+
[string]$remoteNames = Join-Path -Path $AppRemotePath -ChildPath '\Configs\AdminMenu.prereqs' -ErrorAction SilentlyContinue
229229
If (-not (Test-Path $remoteConfig -ErrorAction SilentlyContinue) -and (-not (Test-Path $remoteNames -ErrorAction SilentlyContinue)) ){
230230
If ($AppOptionDebugeMode){Write-Log -Message "Remote config files were not found at: $AppRemotePath; local config will be processed instead" -Severity 2 -OutputHost}
231231
[boolean]$AppUseRemoteConfig = $False

App/AdminMenu.ps1.names

Lines changed: 0 additions & 10 deletions
This file was deleted.

App/Configs/AdminMenu.prereqs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[App]
2+
Script=(Get-WmiObject -Class 'Win32_OperatingSystem' -ErrorAction 'SilentlyContinue').Version
3+
ValueGreaterThan=6
4+
5+
[Elevated]
6+
Function=Confirm-Elevated
7+
Value=True
8+
9+
[PowerShell]
10+
Function=Confirm-PSVersion
11+
ValueGreaterThan=5
12+
13+
[RSAT]
14+
Function=Confirm-RSATInstalled
15+
Value=True

0 commit comments

Comments
 (0)