Skip to content

Commit 143308e

Browse files
Merge pull request #33 from theohbrothers/refactor/get-module-s-version-dynamically-when-using-version
Refactor: Get module's version dynamically when using -Version
2 parents f1027ce + f9ec598 commit 143308e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Log-Rotate/public/Log-Rotate.ps1

+3-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function Log-Rotate {
8888
,
8989
[alias("u")]
9090
[switch]$Usage
91-
,
91+
,
9292
[alias("v")]
9393
[switch]$Version
9494
)
@@ -115,10 +115,9 @@ function Log-Rotate {
115115
$PSDefaultParameterValues['Out-File:Force'] = $true
116116
$PSDefaultParameterValues['Invoke-Command:ErrorAction'] = 'Stop'
117117

118-
# Prints miscellaneous information and exits
119-
$LogRotateVersion = '1.2.2'
118+
# Prints version and exits
120119
if ($Version) {
121-
Write-Output "Log-Rotate $LogRotateVersion"
120+
Write-Output "Log-Rotate $( (Get-Module Log-Rotate).Version )"
122121
return
123122
}
124123
if ($Help) {

0 commit comments

Comments
 (0)