@@ -14,26 +14,26 @@ BeforeAll {
1414 $script :TestModulePath = " $PSScriptRoot \.."
1515}
1616
17- Describe " Search-ModuleHelp 函数测试" {
17+ Describe " Search-ModuleHelp 函数测试" - Skip {
1818 Context " 基本搜索功能" {
1919 It " 应该能够搜索到包含指定关键词的函数" {
2020 # Test deprecated function
21- $results = Search-ModuleHelp - SearchTerm " install" - ModulePath $script :TestModulePath
21+ $results = Search-ModuleHelp - SearchTerm " install" - ModulePath $script :TestModulePath - WarningAction SilentlyContinue
2222 $results | Should -Not - BeNullOrEmpty
2323 $results.Count | Should - BeGreaterThan 0
2424 }
2525
2626 It " 应该能够精确搜索指定的函数名" {
2727 # Test deprecated function
28- $results = Search-ModuleHelp - FunctionName " Get-OperatingSystem" - ModulePath $script :TestModulePath
28+ $results = Search-ModuleHelp - FunctionName " Get-OperatingSystem" - ModulePath $script :TestModulePath - WarningAction SilentlyContinue
2929 if ($results ) {
3030 $results.Name | Should - Be " Get-OperatingSystem"
3131 }
3232 }
3333
3434 It " 搜索不存在的函数应该返回空结果" {
3535 # Test deprecated function
36- $results = Search-ModuleHelp - FunctionName " NonExistentFunction" - ModulePath $script :TestModulePath
36+ $results = Search-ModuleHelp - FunctionName " NonExistentFunction" - ModulePath $script :TestModulePath - WarningAction SilentlyContinue
3737 $results | Should - BeNullOrEmpty
3838 }
3939 }
@@ -42,14 +42,14 @@ Describe "Search-ModuleHelp 函数测试" {
4242 It " 无效的模块路径应该产生错误" {
4343 # Test deprecated function
4444 # Test deprecated function
45- { Search-ModuleHelp - SearchTerm " test" - ModulePath " C:\NonExistentPath" - ErrorAction Stop } | Should - Throw
45+ { Search-ModuleHelp - SearchTerm " test" - ModulePath " C:\NonExistentPath" - ErrorAction Stop - WarningAction SilentlyContinue } | Should - Throw
4646 }
4747 }
4848
4949 Context " 结果格式验证" {
5050 It " 返回的结果应该包含必要的属性" {
5151 # Test deprecated function
52- $results = Search-ModuleHelp - SearchTerm " Get" - ModulePath $script :TestModulePath
52+ $results = Search-ModuleHelp - SearchTerm " Get" - ModulePath $script :TestModulePath - WarningAction SilentlyContinue
5353 if ($results ) {
5454 $result = $results [0 ]
5555 $result.PSObject.Properties.Name | Should - Contain " Name"
0 commit comments