Skip to content

Commit

Permalink
Release NPSLogFile version 1.0.0.1
Browse files Browse the repository at this point in the history
Release NPSLogFile version 1.0.0.1
  • Loading branch information
AndiBellstedt authored Nov 19, 2020
2 parents fda4edd + 0dcf3cf commit 462b87c
Show file tree
Hide file tree
Showing 19 changed files with 3,164 additions and 3,989 deletions.
9 changes: 6 additions & 3 deletions NPSLogFile/NPSLogFile.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RootModule = 'NPSLogFile.psm1'

# Version number of this module.
ModuleVersion = '1.0.0.0'
ModuleVersion = '1.0.0.1'

# ID used to uniquely identify this module
GUID = '6dc7831e-141b-4d35-9868-10c023efe87b'
Expand Down Expand Up @@ -91,9 +91,12 @@
'NPSLog',
'NPSLogFile',
'LogFile',
'LogFiles',
'Automation',
'NetworkPolicyServer',
'Logging'
'Logging',
'PSEdition_Desktop',
'Windows'
)

# A URL to the license for this module.
Expand All @@ -106,7 +109,7 @@
IconUri = 'https://github.com/AndiBellstedt/NPSLogFile/raw/Development/assets/NPSLogFile_128x128.png'

# ReleaseNotes of this module
ReleaseNotes = 'https://github.com/AndiBellstedt/ExchangeLogs/blob/master/ExchangeLogs/changelog.md'
ReleaseNotes = 'https://github.com/AndiBellstedt/NPSLogFile/blob/master/NPSLogFile/changelog.md'

} # End of PSData hashtable

Expand Down
69 changes: 18 additions & 51 deletions NPSLogFile/NPSLogFile.psm1
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
$script:ModuleRoot = $PSScriptRoot
$script:ModuleVersion = (Import-PowerShellDataFile -Path "$($script:ModuleRoot)\NPSLogFile.psd1").ModuleVersion
New-Variable -Option ReadOnly, Constant -Scope Script -Name BaseType -Value "NPS.LogFile"

# Detect whether at some level dotsourcing was enforced
$script:doDotSource = Get-PSFConfigValue -FullName NPSLogFile.Import.DoDotSource -Fallback $false
if ($NPSLogFile_dotsourcemodule) { $script:doDotSource = $true }

<#
Note on Resolve-Path:
All paths are sent through Resolve-Path/Resolve-PSFPath in order to convert them to the correct path separator.
This allows ignoring path separators throughout the import sequence, which could otherwise cause trouble depending on OS.
Resolve-Path can only be used for paths that already exist, Resolve-PSFPath can accept that the last leaf my not exist.
This is important when testing for paths.
#>

# Detect whether at some level loading individual module files, rather than the compiled module was enforced
$importIndividualFiles = Get-PSFConfigValue -FullName NPSLogFile.Import.IndividualFiles -Fallback $false
if ($NPSLogFile_importIndividualFiles) { $importIndividualFiles = $true }
if (Test-Path (Resolve-PSFPath -Path "$($script:ModuleRoot)\..\.git" -SingleItem -NewChild)) { $importIndividualFiles = $true }
if ("<was not compiled>" -eq '<was not compiled>') { $importIndividualFiles = $true }
New-Variable -Option ReadOnly, Constant -Scope Script -Name BaseType -Value "NPS.LogFile"

#region Helper function
function Import-ModuleFile {
<#
.SYNOPSIS
Expand All @@ -45,46 +29,29 @@ function Import-ModuleFile {
$Path
)

$resolvedPath = $ExecutionContext.SessionState.Path.GetResolvedPSPathFromPSPath($Path).ProviderPath
if ($doDotSource) {
. $resolvedPath
if ($script:dontDotSource) {
$ExecutionContext.InvokeCommand.InvokeScript($false, ([scriptblock]::Create([io.file]::ReadAllText((Resolve-Path $Path)))), $null, $null)
} else {
$ExecutionContext.InvokeCommand.InvokeScript(
$false,
([scriptblock]::Create([io.file]::ReadAllText($resolvedPath))),
$null,
$null
)
. (Resolve-Path $Path)
}
}
#endregion Helper function

#region Load individual files
if ($importIndividualFiles) {
# Execute Preimport actions
foreach ($path in (& "$ModuleRoot\internal\scripts\preimport.ps1")) {
. Import-ModuleFile -Path $path
}

# Import all internal functions
foreach ($function in (Get-ChildItem "$ModuleRoot\internal\functions" -Filter "*.ps1" -Recurse -ErrorAction Ignore)) {
. Import-ModuleFile -Path $function.FullName
}
# Perform Actions before loading the rest of the content
. Import-ModuleFile -Path "$ModuleRoot\internal\scripts\preimport.ps1"

# Import all public functions
foreach ($function in (Get-ChildItem "$ModuleRoot\functions" -Filter "*.ps1" -Recurse -ErrorAction Ignore)) {
. Import-ModuleFile -Path $function.FullName
}

# Execute Postimport actions
foreach ($path in (& "$ModuleRoot\internal\scripts\postimport.ps1")) {
. Import-ModuleFile -Path $path
}
#region Load functions
foreach ($function in (Get-ChildItem "$ModuleRoot\internal\functions" -Recurse -File -Filter "*.ps1")) {
. Import-ModuleFile -Path $function.FullName
}

# End it here, do not load compiled code below
return
foreach ($function in (Get-ChildItem "$ModuleRoot\functions" -Recurse -File -Filter "*.ps1")) {
. Import-ModuleFile -Path $function.FullName
}
#endregion Load individual files
#endregion Load functions


#region Load compiled code
"<compile code into here>"
#endregion Load compiled code
# Perform Actions after loading the module contents
. Import-ModuleFile -Path "$ModuleRoot\internal\scripts\postimport.ps1"
6 changes: 6 additions & 0 deletions changelog.md → NPSLogFile/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Changelog
## 1.0.0.1 (2020-11-18)
- No functional changes
- Fix: Fixing some typos
- Fix: Remove files and command depend on PSFramework
- Upd: Add plattform and statistic information to readme file

## 1.0.0 Inital module release
- New: Get-NPSLog

Expand Down
5 changes: 0 additions & 5 deletions NPSLogFile/en-us/strings.psd1

This file was deleted.

Loading

0 comments on commit 462b87c

Please sign in to comment.