@@ -203,6 +203,60 @@ function Get-TestData {
203203 }
204204 }
205205
206+ Context ' Install-AITool Scope Parameter' {
207+ It ' Should accept CurrentUser scope' {
208+ # CurrentUser is the default, should work without issues
209+ $result = Install-AITool - Name Claude - Scope CurrentUser - SkipInitialization
210+ $result | Should -Not - BeNullOrEmpty
211+ $result.Result | Should - Be ' Success'
212+ }
213+
214+ It ' Should accept LocalMachine scope parameter' {
215+ # Verify the parameter is accepted (actual installation may require sudo)
216+ { Get-Command Install-AITool | Should -Not - BeNullOrEmpty } | Should -Not - Throw
217+ $cmd = Get-Command Install-AITool
218+ $cmd.Parameters [' Scope' ] | Should -Not - BeNullOrEmpty
219+ $cmd.Parameters [' Scope' ].ParameterType.Name | Should - Be ' String'
220+ }
221+
222+ It ' Should have valid Scope parameter values' {
223+ $cmd = Get-Command Install-AITool
224+ $validateSet = $cmd.Parameters [' Scope' ].Attributes | Where-Object { $_ -is [System.Management.Automation.ValidateSetAttribute ] }
225+ $validateSet.ValidValues | Should - Contain ' CurrentUser'
226+ $validateSet.ValidValues | Should - Contain ' LocalMachine'
227+ }
228+
229+ It ' Should handle LocalMachine scope for already-installed tool' {
230+ # Claude is already installed, so this tests the code path without needing sudo
231+ $result = Install-AITool - Name Claude - Scope LocalMachine - SkipInitialization
232+ $result | Should -Not - BeNullOrEmpty
233+ $result.Result | Should - Be ' Success'
234+ $result.Installer | Should - Be ' Already Installed'
235+ }
236+ }
237+
238+ Context ' Uninstall-AITool Scope Parameter' {
239+ It ' Should accept Scope parameter' {
240+ $cmd = Get-Command Uninstall-AITool
241+ $cmd.Parameters [' Scope' ] | Should -Not - BeNullOrEmpty
242+ $cmd.Parameters [' Scope' ].ParameterType.Name | Should - Be ' String'
243+ }
244+
245+ It ' Should have valid Scope parameter values' {
246+ $cmd = Get-Command Uninstall-AITool
247+ $validateSet = $cmd.Parameters [' Scope' ].Attributes | Where-Object { $_ -is [System.Management.Automation.ValidateSetAttribute ] }
248+ $validateSet.ValidValues | Should - Contain ' CurrentUser'
249+ $validateSet.ValidValues | Should - Contain ' LocalMachine'
250+ }
251+
252+ It ' Should default to CurrentUser scope' {
253+ $cmd = Get-Command Uninstall-AITool
254+ $scopeParam = $cmd.Parameters [' Scope' ]
255+ # Check that it has a default value
256+ $scopeParam.Attributes | Where-Object { $_ -is [System.Management.Automation.ParameterAttribute ] } | Should -Not - BeNullOrEmpty
257+ }
258+ }
259+
206260}
207261
208262AfterAll {
0 commit comments