Closed
Description
Steps to reproduce
class SecretComparer : System.Collections.IComparer {
[int] $ChangeInDays = 7
[bool] ShouldChangeSecret() {
#throw "method not implemented"
return $true
}
# this will compare if the secret is same
[int] Compare([object] $obja, [object] $objb) {
throw "method not implemented"
}
}
using module .\Clarksons.Scripts.PlatformEngineering.DevsKeyVault.SecretComparer.psm1
class KeyVault {
[string] $KeyVaultName
KeyVault([string] $KeyVaultName, [SecretComparer] $comparer) {
write-host $comparer
}
}
$t = [SecretComparer]::new()
$x = [KeyVault]::new('gfdgfd', $t)
Expected behavior
This message should not appear as I'm loading classes into the sessions
Actual behavior
If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.14393.693
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.693
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.17.1
Metadata
Metadata
Assignees
Labels
No labels