Skip to content
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
Binary file added CSTijgers/DCToolbox-main/DCToolbox/DCToolbox.psd1
Binary file not shown.
8,124 changes: 8,124 additions & 0 deletions CSTijgers/DCToolbox-main/DCToolbox/DCToolbox.psm1

Large diffs are not rendered by default.

1,336 changes: 1,336 additions & 0 deletions CSTijgers/DCToolbox-main/README.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$jsonFilePath = "C:\Users\ramaz\Desktop\jsonTestCases\100_test_cases_with_deviceFilters.json"

# Load file
$testCases = Get-Content -Path $jsonFilePath | ConvertFrom-Json

# Loop
foreach ($testCase in $testCases) {
$Parameters = @{
UserPrincipalName = $testCase.UserPrincipalName
ApplicationDisplayName = $testCase.ApplicationDisplayName
ClientApp = $testCase.ClientApp
TrustedIPAddress = [bool]$testCase.TrustedIPAddress
Country = $testCase.Country
Platform = $testCase.Platform
SignInRiskLevel = $testCase.SignInRiskLevel
UserRiskLevel = $testCase.UserRiskLevel
SummarizedOutput = $true
VerbosePolicyEvaluation = $false
IncludeNonMatchingPolicies = $false
DeviceId = $testCase.DeviceId
DisplayName = $testCase.DisplayName
DeviceOwnership = $testCase.DeviceOwnership
EnrollmentProfileName = $testCase.EnrollmentProfileName
IsCompliant = $testCase.IsCompliant
Manufacturer = $testCase.Manufacturer
MdmAppId = $testCase.MdmAppId
Model = $testCase.Model
OperatingSystem = $testCase.OperatingSystem
OperatingSystemVersion = $testCase.OperatingSystemVersion
PhysicalIds = $testCase.PhysicalIds
ProfileType = $testCase.ProfileType
SystemLabels = $testCase.SystemLabels
TrustType = $testCase.TrustType
}
Write-Host "Running test case for user: $($testCase.UserPrincipalName)"
Invoke-DCConditionalAccessSimulationWithDevices @Parameters
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Test-PowerShellCommand-device.ps1
Describe "Test Command Output for Conditional Access Simulation" {
It "should match the expected output from file" {
# Path to the .txt file containing the original script
$scriptPath = "D:\HBO-ICT\CST\project\command2device.txt"

# Read the contents of the file and execute it
$scriptContent = Get-Content -Path $scriptPath -Raw

# Create a temporary file to capture the output (instead of using Write-Host)
$outputFile = "D:\HBO-ICT\CST\project\test_output_device.txt"

# Redirect the output of the script to a file
Invoke-Expression -Command $scriptContent | Out-File -FilePath $outputFile -Force

# Read the expected output from the expected output file
$expectedOutputFile = "D:\HBO-ICT\CST\project\expected_output_device.txt"
$expectedOutput = Get-Content -Path $expectedOutputFile -Raw

# Read the actual output from the captured file
$actualOutput = Get-Content -Path $outputFile -Raw

# Compare the actual output to the expected output
$actualOutput | Should -BeExactly $expectedOutput
}
}
Loading