- N +

关注儿童健康,庆祝节日快乐

($LocationString.EndsWith('/nuget', [System.StringComparison]::OrdinalIgnoreCase)) -and -not ($LocationString.EndsWith('/nuget/', [System.StringComparison]::OrdinalIgnoreCase)) -and -not ($LocationString.EndsWith('index.json', [System.StringComparison]::OrdinalIgnoreCase)) -and -not ($LocationString.EndsWith('index.json/', [System.StringComparison]::OrdinalIgnoreCase)) ) { $message = $LocalizedData.SourceLocationUrisForModulesAndScriptsShouldBeDifferent -f ($LocationString, $ScriptSourceLocation) ThrowError -ExceptionName "System.InvalidOperationException" ` -ExceptionMessage $message ` -ErrorId "SourceLocationUrisForModulesAndScriptsShouldBeDifferent" ` -CallerPSCmdlet $PSCmdlet ` -ErrorCategory InvalidOperation ` -ExceptionObject $Location } } } # no error so we can safely remove the source if($script:PSGetModuleSources.Contains($Name)) { $null = $script:PSGetModuleSources.Remove($Name) } # Add new module source $moduleSource = Microsoft.PowerShell.Utility\New-Object PSCustomObject -Property ([ordered]@{ Name = $Name SourceLocation = $LocationString PublishLocation = $PublishLocation ScriptSourceLocation = $ScriptSourceLocation ScriptPublishLocation = $ScriptPublishLocation Trusted=$Trusted Registered= (-not $IsNewModuleSource) InstallationPolicy = if($Trusted) {'Trusted'} else {'Untrusted'} PackageManagementProvider = $SelectedProvider.ProviderName ProviderOptions = $ProviderOptions }) #region telemetry - Capture non-PSGallery registrations as telemetry events if ($script:TelemetryEnabled) { Log-NonPSGalleryRegistration -sourceLocation $moduleSource.SourceLocation ` -installationPolicy $moduleSource.InstallationPolicy
返回列表
上一篇:上一篇:陆游《诉衷情·当年万里觅封侯》翻译注释赏析
下一篇:下一篇:没有了