When using Add-PackageSource, there is no verification of whether the source actually exists. It just adds the source with no questions asked and you won't know until you attempt to find/install a package that the path is not valid.
```
Add-PackageSource -Name Fail -Location http://this.willnotwork.com/keeptrying -Provider Chocolatey
```
Even though this is obviously wrong, it is still added and appears in the list of sources when using Get-Packagesource.
Some sort of checking, be it using Invoke-WebRequest (if url; otherwise Test-Path for folder) or some other approach to verify the validity of the location would help to ensure that the proper package sources are being added to the list of available sources.
Comments: We've talking about handling repository verification during add-packagesource It's always going to be up to the package provider to validate a location, although we'll expose this thru the plugin-model API. I'm torn between making it verify it by default, or making the verification check a switch. ``` powershell > Add-PackageSource -Name foo -Location http://foo -Provider Chocolatey -NoVerify ``` vs ``` powershell > Add-PackageSource -Name foo -Location http://foo -Provider Chocolatey -Verify ``` I'm going to consult the PowerShell core team to see which way they'd like it, and get back to you.
```
Add-PackageSource -Name Fail -Location http://this.willnotwork.com/keeptrying -Provider Chocolatey
```
Even though this is obviously wrong, it is still added and appears in the list of sources when using Get-Packagesource.
Some sort of checking, be it using Invoke-WebRequest (if url; otherwise Test-Path for folder) or some other approach to verify the validity of the location would help to ensure that the proper package sources are being added to the list of available sources.
Comments: We've talking about handling repository verification during add-packagesource It's always going to be up to the package provider to validate a location, although we'll expose this thru the plugin-model API. I'm torn between making it verify it by default, or making the verification check a switch. ``` powershell > Add-PackageSource -Name foo -Location http://foo -Provider Chocolatey -NoVerify ``` vs ``` powershell > Add-PackageSource -Name foo -Location http://foo -Provider Chocolatey -Verify ``` I'm going to consult the PowerShell core team to see which way they'd like it, and get back to you.