-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathTestModuleTwo.psm1
More file actions
36 lines (31 loc) · 996 Bytes
/
Copy pathTestModuleTwo.psm1
File metadata and controls
36 lines (31 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# If your default configuration has valid defaults, but you still want them to review it,
# Provide a public Get-Configuration and test the path(s):
Write-Verbose "No Settings"
function TestStoragePath {
$Path = Get-StoragePath
Test-Path (Join-Path $Path "Configuration.psd1")
}
function Set-AimConfiguration {
[CmdletBinding()]
param(
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[string]$Address
)
process {
$PSBoundParameters | Export-Configuration
}
}
function Get-AimConfiguration {
Import-Configuration
}
if (!(TestStoragePath -Verbose)) {
Write-Warning "Not Configured"
Write-Host @"
Welcome first-time users:
You should review and approve the configuration of this module by running:
`$Configuration = Get-AimConfiguration
`$Configuration
And then review the settings. When you're satisfied, approve them by:
Set-AimConfiguration @Configuration
"@ -ForegroundColor Black -BackgroundColor Yellow
}