如何[System.IO.Path]::IsPathRooted()
使用 Pester 模拟?我尝试了以下但没有运气。
Describe "Configuration" {
Mock [System.IO.Path]::IsPathRooted {
return false
}
It "should mock rooted Path" {
[System.IO.Path]::IsPathRooted("C:\a") | Should Be False
}