mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Spelling ps1 (#2256)
* spelling: locals in src/Modules/Shared/PowerShellGet * spelling: locals in src/Modules/Windows-Full
This commit is contained in:
@@ -122,7 +122,7 @@ $script:NuGetProviderName = "NuGet"
|
||||
$script:NuGetProviderVersion = [Version]'2.8.5.201'
|
||||
|
||||
$script:SupportsPSModulesFeatureName="supports-powershell-modules"
|
||||
$script:FastPackRefHastable = @{}
|
||||
$script:FastPackRefHashtable = @{}
|
||||
$script:NuGetBinaryProgramDataPath=if(IsWindows) {"$env:ProgramFiles\PackageManagement\ProviderAssemblies"}
|
||||
$script:NuGetBinaryLocalAppDataPath=if(IsWindows) {"$env:LOCALAPPDATA\PackageManagement\ProviderAssemblies"}
|
||||
# go fwlink for 'https://nuget.org/nuget.exe'
|
||||
@@ -3313,12 +3313,12 @@ function Install-Script
|
||||
if(-not (Test-RunningAsElevated) -and ($Scope -ne "CurrentUser"))
|
||||
{
|
||||
# Throw an error when Install-Script is used as a non-admin user and '-Scope CurrentUser' is not specified
|
||||
$AdminPreviligeErrorMessage = $LocalizedData.InstallScriptNeedsCurrentUserScopeParameterForNonAdminUser -f @($script:ProgramFilesScriptsPath, $script:MyDocumentsScriptsPath)
|
||||
$AdminPreviligeErrorId = 'InstallScriptNeedsCurrentUserScopeParameterForNonAdminUser'
|
||||
$AdminPrivilegeErrorMessage = $LocalizedData.InstallScriptNeedsCurrentUserScopeParameterForNonAdminUser -f @($script:ProgramFilesScriptsPath, $script:MyDocumentsScriptsPath)
|
||||
$AdminPrivilegeErrorId = 'InstallScriptNeedsCurrentUserScopeParameterForNonAdminUser'
|
||||
|
||||
ThrowError -ExceptionName "System.ArgumentException" `
|
||||
-ExceptionMessage $AdminPreviligeErrorMessage `
|
||||
-ErrorId $AdminPreviligeErrorId `
|
||||
-ExceptionMessage $AdminPrivilegeErrorMessage `
|
||||
-ErrorId $AdminPrivilegeErrorId `
|
||||
-CallerPSCmdlet $PSCmdlet `
|
||||
-ErrorCategory InvalidArgument
|
||||
}
|
||||
@@ -3975,17 +3975,17 @@ function Register-PSRepository
|
||||
{
|
||||
if (Get-Variable -Name SourceLocation -ErrorAction SilentlyContinue)
|
||||
{
|
||||
Set-Variable -Name selctedProviderName -value $null -Scope 1
|
||||
Set-Variable -Name selectedProviderName -value $null -Scope 1
|
||||
|
||||
if(Get-Variable -Name PackageManagementProvider -ErrorAction SilentlyContinue)
|
||||
{
|
||||
$selctedProviderName = $PackageManagementProvider
|
||||
$null = Get-DynamicParameters -Location $SourceLocation -PackageManagementProvider ([REF]$selctedProviderName)
|
||||
$selectedProviderName = $PackageManagementProvider
|
||||
$null = Get-DynamicParameters -Location $SourceLocation -PackageManagementProvider ([REF]$selectedProviderName)
|
||||
}
|
||||
else
|
||||
{
|
||||
$dynamicParameters = Get-DynamicParameters -Location $SourceLocation -PackageManagementProvider ([REF]$selctedProviderName)
|
||||
Set-Variable -Name PackageManagementProvider -Value $selctedProviderName -Scope 1
|
||||
$dynamicParameters = Get-DynamicParameters -Location $SourceLocation -PackageManagementProvider ([REF]$selectedProviderName)
|
||||
Set-Variable -Name PackageManagementProvider -Value $selectedProviderName -Scope 1
|
||||
$null = $dynamicParameters
|
||||
}
|
||||
}
|
||||
@@ -4067,9 +4067,9 @@ function Register-PSRepository
|
||||
{
|
||||
$providerName = $PackageManagementProvider
|
||||
}
|
||||
elseif($selctedProviderName)
|
||||
elseif($selectedProviderName)
|
||||
{
|
||||
$providerName = $selctedProviderName
|
||||
$providerName = $selectedProviderName
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4536,16 +4536,16 @@ function Test-ScriptFileInfo
|
||||
|
||||
$notSupportedOnNanoErrorIds = @('WorkflowNotSupportedInPowerShellCore',
|
||||
'ConfigurationNotSupportedInPowerShellCore')
|
||||
$errosAfterSkippingOneCoreErrors = $errors | Microsoft.PowerShell.Core\Where-Object { $notSupportedOnNanoErrorIds -notcontains $_.ErrorId}
|
||||
$errorsAfterSkippingOneCoreErrors = $errors | Microsoft.PowerShell.Core\Where-Object { $notSupportedOnNanoErrorIds -notcontains $_.ErrorId}
|
||||
|
||||
if($errosAfterSkippingOneCoreErrors)
|
||||
if($errorsAfterSkippingOneCoreErrors)
|
||||
{
|
||||
$errorMessage = ($LocalizedData.ScriptParseError -f $scriptFilePath)
|
||||
ThrowError -ExceptionName "System.ArgumentException" `
|
||||
-ExceptionMessage $errorMessage `
|
||||
-ErrorId "ScriptParseError" `
|
||||
-CallerPSCmdlet $PSCmdlet `
|
||||
-ExceptionObject $errosAfterSkippingOneCoreErrors `
|
||||
-ExceptionObject $errorsAfterSkippingOneCoreErrors `
|
||||
-ErrorCategory InvalidArgument
|
||||
return
|
||||
}
|
||||
@@ -10053,7 +10053,7 @@ function Find-Package
|
||||
-Type $artifactType `
|
||||
-request $request
|
||||
|
||||
$script:FastPackRefHastable[$fastPackageReference] = $pkg
|
||||
$script:FastPackRefHashtable[$fastPackageReference] = $pkg
|
||||
|
||||
Write-Output -InputObject $sid
|
||||
}
|
||||
@@ -10147,22 +10147,22 @@ function Install-PackageUtility
|
||||
$packageName = $parts[1]
|
||||
$version = $parts[2]
|
||||
$sourceLocation= $parts[3]
|
||||
$artfactType = $parts[4]
|
||||
$artifactType = $parts[4]
|
||||
|
||||
# The default destination location for Modules and Scripts is ProgramFiles path
|
||||
$scriptDestination = $script:ProgramFilesScriptsPath
|
||||
$moduleDestination = $script:programFilesModulesPath
|
||||
$Scope = 'AllUsers'
|
||||
|
||||
if($artfactType -eq $script:PSArtifactTypeScript)
|
||||
if($artifactType -eq $script:PSArtifactTypeScript)
|
||||
{
|
||||
$AdminPreviligeErrorMessage = $LocalizedData.InstallScriptNeedsCurrentUserScopeParameterForNonAdminUser -f @($script:ProgramFilesScriptsPath, $script:MyDocumentsScriptsPath)
|
||||
$AdminPreviligeErrorId = 'InstallScriptNeedsCurrentUserScopeParameterForNonAdminUser'
|
||||
$AdminPrivilegeErrorMessage = $LocalizedData.InstallScriptNeedsCurrentUserScopeParameterForNonAdminUser -f @($script:ProgramFilesScriptsPath, $script:MyDocumentsScriptsPath)
|
||||
$AdminPrivilegeErrorId = 'InstallScriptNeedsCurrentUserScopeParameterForNonAdminUser'
|
||||
}
|
||||
else
|
||||
{
|
||||
$AdminPreviligeErrorMessage = $LocalizedData.InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser -f @($script:programFilesModulesPath, $script:MyDocumentsModulesPath)
|
||||
$AdminPreviligeErrorId = 'InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser'
|
||||
$AdminPrivilegeErrorMessage = $LocalizedData.InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser -f @($script:programFilesModulesPath, $script:MyDocumentsModulesPath)
|
||||
$AdminPrivilegeErrorId = 'InstallModuleNeedsCurrentUserScopeParameterForNonAdminUser'
|
||||
}
|
||||
|
||||
$installUpdate = $false
|
||||
@@ -10195,8 +10195,8 @@ function Install-PackageUtility
|
||||
{
|
||||
# Throw an error when Install-Module/Script is used as a non-admin user and '-Scope CurrentUser' is not specified
|
||||
ThrowError -ExceptionName "System.ArgumentException" `
|
||||
-ExceptionMessage $AdminPreviligeErrorMessage `
|
||||
-ErrorId $AdminPreviligeErrorId `
|
||||
-ExceptionMessage $AdminPrivilegeErrorMessage `
|
||||
-ErrorId $AdminPrivilegeErrorId `
|
||||
-CallerPSCmdlet $PSCmdlet `
|
||||
-ErrorCategory InvalidArgument
|
||||
}
|
||||
@@ -10214,8 +10214,8 @@ function Install-PackageUtility
|
||||
elseif(-not (Test-RunningAsElevated))
|
||||
{
|
||||
ThrowError -ExceptionName "System.ArgumentException" `
|
||||
-ExceptionMessage $AdminPreviligeErrorMessage `
|
||||
-ErrorId $AdminPreviligeErrorId `
|
||||
-ExceptionMessage $AdminPrivilegeErrorMessage `
|
||||
-ErrorId $AdminPrivilegeErrorId `
|
||||
-CallerPSCmdlet $PSCmdlet `
|
||||
-ErrorCategory InvalidArgument
|
||||
}
|
||||
@@ -10332,7 +10332,7 @@ function Install-PackageUtility
|
||||
}
|
||||
}
|
||||
|
||||
if($Scope -and ($artfactType -eq $script:PSArtifactTypeScript) -and (-not $installUpdate))
|
||||
if($Scope -and ($artifactType -eq $script:PSArtifactTypeScript) -and (-not $installUpdate))
|
||||
{
|
||||
ValidateAndSet-PATHVariableIfUserAccepts -Scope $Scope `
|
||||
-ScopePath $scriptDestination `
|
||||
@@ -10341,7 +10341,7 @@ function Install-PackageUtility
|
||||
-Force:$Force
|
||||
}
|
||||
|
||||
if($artfactType -eq $script:PSArtifactTypeModule)
|
||||
if($artifactType -eq $script:PSArtifactTypeModule)
|
||||
{
|
||||
$message = $LocalizedData.ModuleDestination -f @($moduleDestination)
|
||||
}
|
||||
@@ -10352,9 +10352,9 @@ function Install-PackageUtility
|
||||
Write-Verbose $message
|
||||
}
|
||||
|
||||
Write-Debug "ArtfactType is $artfactType"
|
||||
Write-Debug "ArtifactType is $artifactType"
|
||||
|
||||
if($artfactType -eq $script:PSArtifactTypeModule)
|
||||
if($artifactType -eq $script:PSArtifactTypeModule)
|
||||
{
|
||||
# Test if module is already installed
|
||||
$InstalledModuleInfo = if(-not $IsSavePackage){ Test-ModuleInstalled -Name $packageName -RequiredVersion $RequiredVersion }
|
||||
@@ -10415,7 +10415,7 @@ function Install-PackageUtility
|
||||
}
|
||||
}
|
||||
|
||||
if($artfactType -eq $script:PSArtifactTypeScript)
|
||||
if($artifactType -eq $script:PSArtifactTypeScript)
|
||||
{
|
||||
# Test if script is already installed
|
||||
$InstalledScriptInfo = if(-not $IsSavePackage){ Test-ScriptInstalled -Name $packageName }
|
||||
@@ -10495,7 +10495,7 @@ function Install-PackageUtility
|
||||
Write-Verbose ($LocalizedData.SpecifiedLocationAndOGP -f ($provider.ProviderName, $providerName))
|
||||
|
||||
$InstalledItemsList = $null
|
||||
$pkg = $script:FastPackRefHastable[$fastPackageReference]
|
||||
$pkg = $script:FastPackRefHashtable[$fastPackageReference]
|
||||
|
||||
# If an item has dependencies, prepare the list of installed items and
|
||||
# pass it to the NuGet provider to not download the already installed items.
|
||||
@@ -10506,7 +10506,7 @@ function Install-PackageUtility
|
||||
$InstalledItemsList = Microsoft.PowerShell.Core\Get-Module -ListAvailable |
|
||||
Microsoft.PowerShell.Core\ForEach-Object {"$($_.Name)!#!$($_.Version)".ToLower()}
|
||||
|
||||
if($artfactType -eq $script:PSArtifactTypeScript)
|
||||
if($artifactType -eq $script:PSArtifactTypeScript)
|
||||
{
|
||||
$InstalledItemsList += $script:PSGetInstalledScripts.GetEnumerator() |
|
||||
Microsoft.PowerShell.Core\ForEach-Object {
|
||||
@@ -10534,7 +10534,7 @@ function Install-PackageUtility
|
||||
|
||||
$newRequest = $request.CloneRequest( $ProviderOptions, @($SourceLocation), $request.Credential )
|
||||
|
||||
if($artfactType -eq $script:PSArtifactTypeModule)
|
||||
if($artifactType -eq $script:PSArtifactTypeModule)
|
||||
{
|
||||
$message = $LocalizedData.DownloadingModuleFromGallery -f ($packageName, $version, $sourceLocation)
|
||||
}
|
||||
@@ -10544,7 +10544,7 @@ function Install-PackageUtility
|
||||
}
|
||||
Write-Verbose $message
|
||||
|
||||
$installedPkgs = $provider.InstallPackage($script:FastPackRefHastable[$fastPackageReference], $newRequest)
|
||||
$installedPkgs = $provider.InstallPackage($script:FastPackRefHashtable[$fastPackageReference], $newRequest)
|
||||
|
||||
foreach($pkg in $installedPkgs)
|
||||
{
|
||||
@@ -10957,7 +10957,7 @@ function Uninstall-Package
|
||||
$packageName = $parts[1]
|
||||
$version = $parts[2]
|
||||
$sourceLocation= $parts[3]
|
||||
$artfactType = $parts[4]
|
||||
$artifactType = $parts[4]
|
||||
|
||||
if($request.IsCanceled)
|
||||
{
|
||||
@@ -10981,7 +10981,7 @@ function Uninstall-Package
|
||||
}
|
||||
}
|
||||
|
||||
if($artfactType -eq $script:PSArtifactTypeModule)
|
||||
if($artifactType -eq $script:PSArtifactTypeModule)
|
||||
{
|
||||
$moduleName = $packageName
|
||||
$InstalledModuleInfo = $script:PSGetInstalledModules["$($moduleName)$($version)"]
|
||||
@@ -11122,7 +11122,7 @@ function Uninstall-Package
|
||||
|
||||
Write-Output -InputObject $InstalledModuleInfo.SoftwareIdentity
|
||||
}
|
||||
elseif($artfactType -eq $script:PSArtifactTypeScript)
|
||||
elseif($artifactType -eq $script:PSArtifactTypeScript)
|
||||
{
|
||||
$scriptName = $packageName
|
||||
$InstalledScriptInfo = $script:PSGetInstalledScripts["$($scriptName)$($version)"]
|
||||
@@ -11189,7 +11189,7 @@ function Uninstall-Package
|
||||
$scriptFilePath = Microsoft.PowerShell.Management\Join-Path -Path $scriptBase `
|
||||
-ChildPath "$($scriptName).ps1"
|
||||
|
||||
$installledScriptInfoFilePath = Microsoft.PowerShell.Management\Join-Path -Path $installedScriptInfoPath `
|
||||
$installedScriptInfoFilePath = Microsoft.PowerShell.Management\Join-Path -Path $installedScriptInfoPath `
|
||||
-ChildPath "$($scriptName)_$($script:InstalledScriptInfoFileName)"
|
||||
|
||||
# Remove the script file and it's corresponding InstalledScriptInfo.xml
|
||||
@@ -11202,9 +11202,9 @@ function Uninstall-Package
|
||||
-Confirm:$false -WhatIf:$false
|
||||
}
|
||||
|
||||
if(Microsoft.PowerShell.Management\Test-Path -Path $installledScriptInfoFilePath -PathType Leaf)
|
||||
if(Microsoft.PowerShell.Management\Test-Path -Path $installedScriptInfoFilePath -PathType Leaf)
|
||||
{
|
||||
Microsoft.PowerShell.Management\Remove-Item -Path $installledScriptInfoFilePath `
|
||||
Microsoft.PowerShell.Management\Remove-Item -Path $installedScriptInfoFilePath `
|
||||
-Force `
|
||||
-ErrorAction SilentlyContinue `
|
||||
-WarningAction SilentlyContinue `
|
||||
|
||||
+17
-17
@@ -537,16 +537,16 @@ function GenerateClientSideProxyModule
|
||||
|
||||
Write-Verbose ($LocalizedData.VerboseSavingModule -f $outputModule)
|
||||
|
||||
$typeDefinationFileName = "ComplexTypeDefinitions.psm1"
|
||||
$complexTypeMapping = GenerateComplexTypeDefination $metaData $metaDataUri $outputModule $typeDefinationFileName $cmdletAdapter $callerPSCmdlet
|
||||
$typeDefinitionFileName = "ComplexTypeDefinitions.psm1"
|
||||
$complexTypeMapping = GenerateComplexTypeDefinition $metaData $metaDataUri $outputModule $typeDefinitionFileName $cmdletAdapter $callerPSCmdlet
|
||||
|
||||
ProgressBarHelper "Export-ODataEndpointProxy" $progressBarStatus 20 20 1 1
|
||||
|
||||
$complexTypeFileDefinationPath = Join-Path -Path $outputModule -ChildPath $typeDefinationFileName
|
||||
$complexTypeFileDefinitionPath = Join-Path -Path $outputModule -ChildPath $typeDefinitionFileName
|
||||
|
||||
if(Test-Path -Path $complexTypeFileDefinationPath)
|
||||
if(Test-Path -Path $complexTypeFileDefinitionPath)
|
||||
{
|
||||
$proxyFile = New-Object -TypeName System.IO.FileInfo -ArgumentList $complexTypeFileDefinationPath | Get-Item
|
||||
$proxyFile = New-Object -TypeName System.IO.FileInfo -ArgumentList $complexTypeFileDefinitionPath | Get-Item
|
||||
if($callerPSCmdlet -ne $null)
|
||||
{
|
||||
$callerPSCmdlet.WriteObject($proxyFile)
|
||||
@@ -570,7 +570,7 @@ function GenerateClientSideProxyModule
|
||||
|
||||
$moduleDirInfo = [System.IO.DirectoryInfo]::new($outputModule)
|
||||
$moduleManifestName = $moduleDirInfo.Name + ".psd1"
|
||||
GenerateModuleManifest $metaData $outputModule\$moduleManifestName @($typeDefinationFileName, 'ServiceActions.cdxml') $resourceNameMapping $progressBarStatus $callerPSCmdlet
|
||||
GenerateModuleManifest $metaData $outputModule\$moduleManifestName @($typeDefinitionFileName, 'ServiceActions.cdxml') $resourceNameMapping $progressBarStatus $callerPSCmdlet
|
||||
}
|
||||
|
||||
#########################################################
|
||||
@@ -592,7 +592,7 @@ function GenerateCRUDProxyCmdlet
|
||||
[string] $cmdletAdapter,
|
||||
[Hashtable] $resourceNameMapping,
|
||||
[Hashtable] $customData,
|
||||
[Hashtable] $compexTypeMapping,
|
||||
[Hashtable] $complexTypeMapping,
|
||||
[string] $progressBarActivityName,
|
||||
[string] $progressBarStatus,
|
||||
[double] $previousSegmentWeight,
|
||||
@@ -643,7 +643,7 @@ function GenerateCRUDProxyCmdlet
|
||||
|
||||
$navigationProperties = GetAllProperties $entitySet.Type -IncludeOnlyNavigationProperties
|
||||
|
||||
GenerateGetProxyCmdlet $xmlWriter $metaData $keys $navigationProperties $cmdletAdapter $compexTypeMapping
|
||||
GenerateGetProxyCmdlet $xmlWriter $metaData $keys $navigationProperties $cmdletAdapter $complexTypeMapping
|
||||
|
||||
$nonKeyProperties = (GetAllProperties $entitySet.Type) | ? { -not $_.isKey }
|
||||
$nullableProperties = $nonKeyProperties | ? { $_.isNullable }
|
||||
@@ -662,11 +662,11 @@ function GenerateCRUDProxyCmdlet
|
||||
$nonNullableProperties = UpdateNetworkControllerSpecificProperties $nonNullableProperties $additionalProperties $keyProperties $false
|
||||
}
|
||||
|
||||
GenerateNewProxyCmdlet $xmlWriter $metaData $keyProperties $nonNullableProperties $nullableProperties $navigationProperties $cmdletAdapter $compexTypeMapping
|
||||
GenerateNewProxyCmdlet $xmlWriter $metaData $keyProperties $nonNullableProperties $nullableProperties $navigationProperties $cmdletAdapter $complexTypeMapping
|
||||
|
||||
if ($CmdletAdapter -ne "NetworkControllerAdapter")
|
||||
{
|
||||
GenerateSetProxyCmdlet $xmlWriter $keyProperties $nonKeyProperties $compexTypeMapping
|
||||
GenerateSetProxyCmdlet $xmlWriter $keyProperties $nonKeyProperties $complexTypeMapping
|
||||
}
|
||||
|
||||
if ($CmdletAdapter -eq "NetworkControllerAdapter")
|
||||
@@ -674,7 +674,7 @@ function GenerateCRUDProxyCmdlet
|
||||
$keyProperties = GetKeys $entitySet $customData.$name 'Remove'
|
||||
}
|
||||
|
||||
GenerateRemoveProxyCmdlet $xmlWriter $metaData $keyProperties $navigationProperties $cmdletAdapter $compexTypeMapping
|
||||
GenerateRemoveProxyCmdlet $xmlWriter $metaData $keyProperties $navigationProperties $cmdletAdapter $complexTypeMapping
|
||||
|
||||
$entityActions = $metaData.Actions | Where-Object { ($_.EntitySet.Namespace -eq $entitySet.Namespace) -and ($_.EntitySet.Name -eq $entitySet.Name) }
|
||||
|
||||
@@ -1631,14 +1631,14 @@ function AddParametersCDXML
|
||||
[bool] $isMandatory,
|
||||
[string] $prefix,
|
||||
[string] $suffix,
|
||||
[Hashtable] $compleTypeMapping
|
||||
[Hashtable] $complexTypeMapping
|
||||
)
|
||||
|
||||
$properties | ? { $_ -ne $null } | % {
|
||||
$xmlWriter.WriteStartElement('Parameter')
|
||||
$xmlWriter.WriteAttributeString('ParameterName', $_.Name + $suffix)
|
||||
$xmlWriter.WriteStartElement('Type')
|
||||
$PSTypeName = Convert-ODataTypeToCLRType $_.TypeName $compleTypeMapping
|
||||
$PSTypeName = Convert-ODataTypeToCLRType $_.TypeName $complexTypeMapping
|
||||
$xmlWriter.WriteAttributeString('PSType', $PSTypeName)
|
||||
$xmlWriter.WriteEndElement()
|
||||
|
||||
@@ -1663,14 +1663,14 @@ function AddParametersCDXML
|
||||
# GenerateComplexTypeDefinition is a helper function used
|
||||
# to generate complex type definition from the metadata.
|
||||
#########################################################
|
||||
function GenerateComplexTypeDefination
|
||||
function GenerateComplexTypeDefinition
|
||||
{
|
||||
param
|
||||
(
|
||||
[ODataUtils.Metadata] $metaData,
|
||||
[string] $metaDataUri,
|
||||
[string] $OutputModule,
|
||||
[string] $typeDefinationFileName,
|
||||
[string] $typeDefinitionFileName,
|
||||
[string] $cmdletAdapter,
|
||||
[System.Management.Automation.PSCmdlet] $callerPSCmdlet
|
||||
)
|
||||
@@ -1680,10 +1680,10 @@ function GenerateComplexTypeDefination
|
||||
if($metaData -eq $null) { throw ($LocalizedData.ArguementNullError -f "metadata", "GenerateComplexTypeDefination") }
|
||||
if($callerPSCmdlet -eq $null) { throw ($LocalizedData.ArguementNullError -f "PSCmdlet", "GenerateComplexTypeDefination") }
|
||||
|
||||
$Path = "$OutputModule\$typeDefinationFileName"
|
||||
$Path = "$OutputModule\$typeDefinitionFileName"
|
||||
|
||||
# We are currently generating classes for EntityType & ComplexType
|
||||
# defination exposed in the metadata.
|
||||
# definition exposed in the metadata.
|
||||
$typesToBeGenerated = $metaData.EntityTypes+$metadata.ComplexTypes
|
||||
|
||||
if($typesToBeGenerated -ne $null -and $typesToBeGenerated.Count -gt 0)
|
||||
|
||||
+2
-2
@@ -719,14 +719,14 @@ function AddParametersCDXML
|
||||
[bool] $isMandatory,
|
||||
[string] $prefix,
|
||||
[string] $suffix,
|
||||
[Hashtable] $compleTypeMapping
|
||||
[Hashtable] $complexTypeMapping
|
||||
)
|
||||
|
||||
$properties | ? { $_ -ne $null } | % {
|
||||
$xmlWriter.WriteStartElement('Parameter')
|
||||
$xmlWriter.WriteAttributeString('ParameterName', $_.Name + $suffix)
|
||||
$xmlWriter.WriteStartElement('Type')
|
||||
$PSTypeName = Convert-ODataTypeToCLRType $_.TypeName $compleTypeMapping
|
||||
$PSTypeName = Convert-ODataTypeToCLRType $_.TypeName $complexTypeMapping
|
||||
$xmlWriter.WriteAttributeString('PSType', $PSTypeName)
|
||||
$xmlWriter.WriteEndElement()
|
||||
|
||||
|
||||
+19
-19
@@ -1230,8 +1230,8 @@ function GenerateClientSideProxyModule
|
||||
Write-Verbose ($LocalizedData.VerboseSavingModule -f $OutputModule)
|
||||
|
||||
# Save ComplexTypes for all metadata schemas in single file
|
||||
$typeDefinationFileName = "ComplexTypeDefinitions.psm1"
|
||||
$complexTypeMapping = GenerateComplexTypeDefinition $GlobalMetadata $OutputModule $typeDefinationFileName $NormalizedNamespaces
|
||||
$typeDefinitionFileName = "ComplexTypeDefinitions.psm1"
|
||||
$complexTypeMapping = GenerateComplexTypeDefinition $GlobalMetadata $OutputModule $typeDefinitionFileName $NormalizedNamespaces
|
||||
|
||||
ProgressBarHelper "Export-ODataEndpointProxy" $progressBarStatus 20 20 1 1
|
||||
|
||||
@@ -1273,11 +1273,11 @@ function GenerateClientSideProxyModule
|
||||
|
||||
if ($actions.Count -gt 0 -or $functions.Count -gt 0)
|
||||
{
|
||||
$additionalModules = @($typeDefinationFileName, 'ServiceActions.cdxml')
|
||||
$additionalModules = @($typeDefinitionFileName, 'ServiceActions.cdxml')
|
||||
}
|
||||
else
|
||||
{
|
||||
$additionalModules = @($typeDefinationFileName)
|
||||
$additionalModules = @($typeDefinitionFileName)
|
||||
}
|
||||
|
||||
GenerateModuleManifest $GlobalMetadata $OutputModule\$moduleManifestName $additionalModules $resourceNameMappings $progressBarStatus
|
||||
@@ -1300,7 +1300,7 @@ function SaveCDXML
|
||||
[string] $CmdletAdapter,
|
||||
[Hashtable] $resourceNameMappings,
|
||||
[Hashtable] $CustomData,
|
||||
[Hashtable] $compexTypeMapping,
|
||||
[Hashtable] $complexTypeMapping,
|
||||
[string] $UriResourcePathKeyFormat,
|
||||
$normalizedNamespaces
|
||||
)
|
||||
@@ -1335,7 +1335,7 @@ function SaveCDXML
|
||||
|
||||
$navigationProperties = $EntitySet.Type.NavigationProperties
|
||||
|
||||
SaveCDXMLInstanceCmdlets $xmlWriter $Metadata $GlobalMetadata $EntitySet.Type $keys $navigationProperties $CmdletAdapter $compexTypeMapping $false
|
||||
SaveCDXMLInstanceCmdlets $xmlWriter $Metadata $GlobalMetadata $EntitySet.Type $keys $navigationProperties $CmdletAdapter $complexTypeMapping $false
|
||||
|
||||
$nonKeyProperties = $EntitySet.Type.EntityProperties | ? { -not $_.isKey }
|
||||
$nullableProperties = $nonKeyProperties | ? { $_.isNullable }
|
||||
@@ -1345,11 +1345,11 @@ function SaveCDXML
|
||||
|
||||
$keyProperties = $keys
|
||||
|
||||
SaveCDXMLNewCmdlet $xmlWriter $Metadata $GlobalMetadata $keyProperties $nonNullableProperties $nullableProperties $navigationProperties $CmdletAdapter $compexTypeMapping
|
||||
SaveCDXMLNewCmdlet $xmlWriter $Metadata $GlobalMetadata $keyProperties $nonNullableProperties $nullableProperties $navigationProperties $CmdletAdapter $complexTypeMapping
|
||||
|
||||
GenerateSetProxyCmdlet $xmlWriter $keyProperties $nonKeyProperties $compexTypeMapping
|
||||
GenerateSetProxyCmdlet $xmlWriter $keyProperties $nonKeyProperties $complexTypeMapping
|
||||
|
||||
SaveCDXMLRemoveCmdlet $xmlWriter $Metadata $GlobalMetadata $keyProperties $navigationProperties $CmdletAdapter $compexTypeMapping
|
||||
SaveCDXMLRemoveCmdlet $xmlWriter $Metadata $GlobalMetadata $keyProperties $navigationProperties $CmdletAdapter $complexTypeMapping
|
||||
|
||||
$entityActions = $Metadata.Actions | Where-Object { ($_.EntitySet.Namespace -eq $EntitySet.Namespace) -and ($_.EntitySet.Name -eq $EntitySet.Name) }
|
||||
|
||||
@@ -1456,7 +1456,7 @@ function SaveCDXMLSingletonCmdlets
|
||||
[string] $CmdletAdapter,
|
||||
[Hashtable] $resourceNameMappings,
|
||||
[Hashtable] $CustomData,
|
||||
[Hashtable] $compexTypeMapping,
|
||||
[Hashtable] $complexTypeMapping,
|
||||
$normalizedNamespaces
|
||||
)
|
||||
|
||||
@@ -1508,7 +1508,7 @@ function SaveCDXMLSingletonCmdlets
|
||||
|
||||
$navigationProperties = $associatedEntityType.NavigationProperties
|
||||
|
||||
SaveCDXMLInstanceCmdlets $xmlWriter $Metadata $GlobalMetadata $associatedEntityType $keys $navigationProperties $CmdletAdapter $compexTypeMapping $true
|
||||
SaveCDXMLInstanceCmdlets $xmlWriter $Metadata $GlobalMetadata $associatedEntityType $keys $navigationProperties $CmdletAdapter $complexTypeMapping $true
|
||||
|
||||
$nonKeyProperties = $associatedEntityType.EntityProperties | ? { -not $_.isKey }
|
||||
$nullableProperties = $nonKeyProperties | ? { $_.isNullable }
|
||||
@@ -1518,7 +1518,7 @@ function SaveCDXMLSingletonCmdlets
|
||||
|
||||
$keyProperties = $keys
|
||||
|
||||
GenerateSetProxyCmdlet $xmlWriter $keyProperties $nonKeyProperties $compexTypeMapping
|
||||
GenerateSetProxyCmdlet $xmlWriter $keyProperties $nonKeyProperties $complexTypeMapping
|
||||
|
||||
$entityActions = $Metadata.Actions | Where-Object { $_.EntitySet.Name -eq $associatedEntityType.Name }
|
||||
|
||||
@@ -1621,7 +1621,7 @@ function SaveCDXMLInstanceCmdlets
|
||||
# to be used by GET cmdlet
|
||||
if (($keys.Length -gt 0) -or ($navigationProperties.Length -gt 0))
|
||||
{
|
||||
$querableNavProperties = @{}
|
||||
$queryableNavProperties = @{}
|
||||
|
||||
if ($isSingleton -eq $false)
|
||||
{
|
||||
@@ -1636,16 +1636,16 @@ function SaveCDXMLInstanceCmdlets
|
||||
# Otherwise the Uri for associated navigation property won't be valid
|
||||
if ($associatedTypeKeyProperties.Length -gt 0 -and (ShouldBeAssociatedParameter $GlobalMetadata $EntityType $associatedType $isSingleton))
|
||||
{
|
||||
$querableNavProperties.Add($navProperty, $associatedTypeKeyProperties)
|
||||
$queryableNavProperties.Add($navProperty, $associatedTypeKeyProperties)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$defaultCmdletParameterSet = 'Default'
|
||||
if ($isSingleton -eq $true -and $querableNavProperties.Count -gt 0)
|
||||
if ($isSingleton -eq $true -and $queryableNavProperties.Count -gt 0)
|
||||
{
|
||||
foreach($item in $querableNavProperties.GetEnumerator())
|
||||
foreach($item in $queryableNavProperties.GetEnumerator())
|
||||
{
|
||||
$defaultCmdletParameterSet = $item.Key.Name
|
||||
break
|
||||
@@ -1683,9 +1683,9 @@ function SaveCDXMLInstanceCmdlets
|
||||
}
|
||||
}
|
||||
|
||||
if ($querableNavProperties.Count -gt 0)
|
||||
if ($queryableNavProperties.Count -gt 0)
|
||||
{
|
||||
foreach($item in $querableNavProperties.GetEnumerator())
|
||||
foreach($item in $queryableNavProperties.GetEnumerator())
|
||||
{
|
||||
$xmlWriter.WriteStartElement('Property')
|
||||
$xmlWriter.WriteAttributeString('PropertyName', $item.Key.Name + ':' + $item.Value.Name + ':Key')
|
||||
@@ -1940,7 +1940,7 @@ function SaveCDXMLRemoveCmdlet
|
||||
|
||||
$xmlWriter.WriteEndElement()
|
||||
|
||||
$navigationPrperties | ? { $_ -ne $null } | % {
|
||||
$navigationProperties | ? { $_ -ne $null } | % {
|
||||
|
||||
$associatedType = GetAssociatedType $Metadata $GlobalMetadata $_
|
||||
$associatedEntitySet = GetEntitySetForEntityType $Metadata $associatedType
|
||||
|
||||
Reference in New Issue
Block a user