Compare commits
2 Commits
3a427ec324
...
d02ab2b22b
Author | SHA1 | Date | |
---|---|---|---|
d02ab2b22b | |||
10458daf98 |
@@ -129,7 +129,7 @@ If (-Not $NoLog) {
|
|||||||
If (-not $LogDir) {
|
If (-not $LogDir) {
|
||||||
$LogDir = $AppDir
|
$LogDir = $AppDir
|
||||||
}
|
}
|
||||||
Add-LogEntry (Start-Transcript "$AppDir\$ThisScript.log" -Append)
|
Add-LogEntry (Start-Transcript "$LogDir\$ThisScript.log" -Append)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load any modules required by script
|
# Load any modules required by script
|
||||||
|
@@ -392,6 +392,57 @@ Function Import-CSVConfig () {
|
|||||||
Exit
|
Exit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function Import-Config () {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
A brief description of the function or script.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
A longer description.
|
||||||
|
|
||||||
|
.PARAMETER FirstParameter
|
||||||
|
Description of each of the parameters.
|
||||||
|
Note:
|
||||||
|
To make it easier to keep the comments synchronized with changes to the parameters,
|
||||||
|
the preferred location for parameter documentation comments is not here,
|
||||||
|
but within the param block, directly above each parameter.
|
||||||
|
|
||||||
|
.PARAMETER SecondParameter
|
||||||
|
Description of each of the parameters.
|
||||||
|
|
||||||
|
.INPUTS
|
||||||
|
Description of objects that can be piped to the script.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
Description of objects that are output by the script.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Example of how to run the script.
|
||||||
|
|
||||||
|
.LINK
|
||||||
|
Links to further documentation.
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Detail on what the script does, if this is needed.
|
||||||
|
|
||||||
|
#>
|
||||||
|
Param (
|
||||||
|
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ConfigFile
|
||||||
|
)
|
||||||
|
If (Test-Path -Path $ConfigFile) {
|
||||||
|
Try {
|
||||||
|
Switch ((Get-Item -Path $ConfigFile).Extension.ToLower()) {
|
||||||
|
{ @( ".yml", ".yaml").Contains($_) } { Return (Import-YAMLConfig $ConfigFile) }
|
||||||
|
{ @( ".jsn", ".json").Contains($_) } { Return (Import-JSONConfig $ConfigFile) }
|
||||||
|
{ @( ".csv").Contains($_) } { Return (Import-CSVConfig $ConfigFile) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Catch {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Function Set-RegistryKey {
|
Function Set-RegistryKey {
|
||||||
Param(
|
Param(
|
||||||
|
Reference in New Issue
Block a user