Skip to content

Commit

Permalink
Fixed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs committed Apr 7, 2021
1 parent 759aa49 commit 7e2b9b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function Get-TargetResource
-ScriptBlock {
$params = $args[0]

$usageDefinition = Get-SPUsageDefinition | Where-Object { $_.Name -eq $params.Name }
$usageDefinition = Get-SPUsageDefinition -Identity $params.Name
$nullReturn = @{
Name = $params.Name
DaysRetained = $params.DaysRetained
Expand Down Expand Up @@ -162,7 +162,7 @@ function Set-TargetResource
$params = $args[0]
$eventSource = $args[1]

$usageDefinition = Get-SPUsageDefinition | Where-Object { $_.Name -eq $params.Name }
$usageDefinition = Get-SPUsageDefinition -Identity $params.Name

if ($null -eq $usageDefinition)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ try
{
$testParams.UsageDatabaseEnabled = $true
}

Mock -CommandName Get-SPUsageDefinition -MockWith { return $null }
}

It "Should return false when the Test method is called" {
Expand Down

0 comments on commit 7e2b9b8

Please sign in to comment.