Skip to content
Browse files

initial commit (#5528)

  • Loading branch information...
potatoqualitee committed May 15, 2019
1 parent d7e2643 commit 9882af6df1434e31fb91d755db948aab5ca45676
Showing with 79 additions and 0 deletions.
  1. +60 −0 functions/Get-DbatoolsChangeLog.ps1
  2. +19 −0 tests/Get-DbatoolsChangeLog.Tests.ps1
@@ -0,0 +1,60 @@
function Get-DbatoolsChangeLog {
Opens the link to our online change log
Opens the link to our online change log. To see the local changelog instead, use the Local parameter.
Return the local change log to the console
.PARAMETER EnableException
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Tags: changelog
Author: Chrissy LeMaire (@cl),
Copyright: (c) 2018 by dbatools, licensed under MIT
License: MIT
Opens a browser to our online changelog
Get-DbatoolsChangeLog -Local
Returns the content from
param (

try {
if (-not $Local) {
Start-Process ""
} else {
$releasenotes = Get-Content $script:PSModuleRoot\ -Raw

if ($Local) {
($releasenotes -Split "##Local")[0]
} else {
} catch {
Stop-Function -Message "Failure" -ErrorRecord $_
@@ -0,0 +1,19 @@
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
Context "Validate parameters" {
[object[]]$params = (Get-Command $CommandName).Parameters.Keys | Where-Object {$_ -notin ('whatif', 'confirm')}
[object[]]$knownParameters = 'Local', 'EnableException'
$knownParameters += [System.Management.Automation.PSCmdlet]::CommonParameters
It "Should only contain our specific parameters" {
(@(Compare-Object -ReferenceObject ($knownParameters | Where-Object {$_}) -DifferenceObject $params).Count ) | Should Be 0
Integration test should appear below and are custom to the command you are writing.
for more guidence.

0 comments on commit 9882af6

Please sign in to comment.
You can’t perform that action at this time.