Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `NoWait` switch parameter to `New-FabricSQLDatabase` (#123)

### Changed
- `Write-Message` uses `Write-Warning` & `Write-Error` accordingly rather than `Write-Host` with colour (#136)
- Updated `Get-FabricWorkspaceUser` to support pipeline input for `WorkspaceId` and `WorkspaceName` parameters.
- Renamed `Get-FabricWorkspaceUsers` to match the singular form
- Get-FabricSqlDatabase accepts Workspace as a pipeline, handles errors correctly and can filter by name (#117).
Expand Down
17 changes: 8 additions & 9 deletions source/Private/Write-Message.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Write-Message {
[string]$Message,

[Parameter()]
[ValidateSet("Message","Info", "Error", "Warning","Critical", "Verbose", "Debug", IgnoreCase = $true)]
[ValidateSet("Message", "Info", "Error", "Warning", "Critical", "Verbose", "Debug", IgnoreCase = $true)]
[string]$Level = "Info",

[Parameter()]
Expand All @@ -58,14 +58,13 @@ function Write-Message {

# Write log message to console with colors
switch ($Level) {
"Message" { Write-Host $logMessage -ForegroundColor White }
"Info" { Write-Host $logMessage -ForegroundColor Green }
"Error" { Write-Host $logMessage -ForegroundColor Red }
"Warning" { Write-Host $logMessage -ForegroundColor Yellow }
"Critical" { Write-Host $logMessage -ForegroundColor Red }
"Verbose" { Write-Verbose $logMessage }
"Debug" { Write-Debug $logMessage }

"Message" { Write-Host $logMessage -ForegroundColor White }
"Info" { Write-Host $logMessage -ForegroundColor Green }
"Error" { Write-Error $logMessage }
"Warning" { Write-Warning $logMessage }
"Critical" { Write-Host $logMessage -ForegroundColor Red } # Or maybe Stop-PSFunction here?
"Verbose" { Write-Verbose $logMessage }
"Debug" { Write-Debug $logMessage }
}

# Optionally write log message to a file
Expand Down
Loading