Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#66) Adding Tests to ChocoCCM #79

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ gen/generated
.DS_Store
Output/
.dotnet/
coverage.xml
testResults.xml
1 change: 0 additions & 1 deletion src/ChocoCCM.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
'Remove-CCMGroupMember'
'Get-CCMDeployment'
'Get-CCMDeploymentStep'
'Get-CCMDeploymentStepResult'
vexx32 marked this conversation as resolved.
Show resolved Hide resolved
'New-CCMDeployment'
'New-CCMDeploymentStep'
'Set-CCMDeploymentStep'
Expand Down
2 changes: 1 addition & 1 deletion src/Public/Get-CCMComputer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function Get-CCMComputer {
switch ($PSCmdlet.ParameterSetName) {
"Computer" {
foreach ($c in $computer) {
[pscustomobject]$records.result | Where-Object { $_.name -match "$c" }
[pscustomobject]$records.result | Where-Object { $_.name -eq $c }
}
}
"Id" {
Expand Down
6 changes: 5 additions & 1 deletion src/Public/Remove-CCMStaleDeployment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ function Remove-CCMStaleDeployment {
#>
$badStates = @(0, 2, 8)
if ($PSCmdlet.ShouldProcess("$Deployment", "DELETE")) {
Get-CCMDeployment -All | Where-Object { $_.CreationDate -ge (Get-Date).AddDays(-$Age) -and $null -eq $_.StartDateTimeUtc -and $_.Result -in $badStates } | Remove-CCMDeployment
Get-CCMDeployment | Where-Object {
$_.CreationDate -ge (Get-Date).AddDays(-$Age) -and
$null -eq $_.StartDateTimeUtc -and
$_.Result -in $badStates
} | Remove-CCMDeployment
vexx32 marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Loading