Skip to content

Commit

Permalink
Added: The Path parameter for Start-ScriptLogger can now be an empty …
Browse files Browse the repository at this point in the history
…string
  • Loading branch information
claudiospizzi committed Aug 29, 2019
1 parent 024fbf2 commit 502d825
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is mainly based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 3.2.0 - 2019-08-29

* Added: The Path parameter for Start-ScriptLogger can now be an empty string

## 3.1.0 - 2019-02-18

* Added: Optional log rotation (hourly, daily, monthly, yearly)
Expand Down
3 changes: 2 additions & 1 deletion Modules/ScriptLogger/Functions/Start-ScriptLogger.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function Start-ScriptLogger

# The path to the log file.
[Parameter(Mandatory = $false)]
[AllowEmptyString()]
[System.String]
$Path,

Expand Down Expand Up @@ -111,7 +112,7 @@ function Start-ScriptLogger

# If the Path parameter was not specified, add a default value. If possible,
# use the last script called this function. Else use the temp path.
if (-not $PSBoundParameters.ContainsKey('Path'))
if (-not $PSBoundParameters.ContainsKey('Path') -or [System.String]::IsNullOrEmpty($Path))
{
$lastScriptPath = Get-PSCallStack | Select-Object -Skip 1 -First 1 -ExpandProperty 'ScriptName'

Expand Down
4 changes: 2 additions & 2 deletions Modules/ScriptLogger/ScriptLogger.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RootModule = 'ScriptLogger.psm1'

# Version number of this module.
ModuleVersion = '3.1.0'
ModuleVersion = '3.2.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -111,7 +111,7 @@
# IconUri = ''

# ReleaseNotes of this module
# ReleaseNotes = ''
ReleaseNotes = 'https://github.com/claudiospizzi/ScriptLogger/blob/master/CHANGELOG.md'

} # End of PSData hashtable

Expand Down

0 comments on commit 502d825

Please sign in to comment.