@@ -121,46 +121,46 @@ function Add-PatCollectionItem {
121121
122122 # Get machine identifier for URI construction
123123 try {
124- $serverInfoUri = Join-PatUri - BaseUri $effectiveUri - Endpoint ' /'
125- $serverInfo = Invoke-PatApi - Uri $serverInfoUri - Headers $headers - ErrorAction ' Stop'
126- $machineIdentifier = $serverInfo .machineIdentifier
124+ $serverInformationUri = Join-PatUri - BaseUri $effectiveUri - Endpoint ' /'
125+ $serverInformation = Invoke-PatApi - Uri $serverInformationUri - Headers $headers - ErrorAction ' Stop'
126+ $machineIdentifier = $serverInformation .machineIdentifier
127127 Write-Verbose " Server machine identifier: $machineIdentifier "
128128 }
129129 catch {
130130 throw " Failed to retrieve server machine identifier: $ ( $_.Exception.Message ) "
131131 }
132132
133133 $resolvedId = $CollectionId
134- $collectionInfo = $null
134+ $collectionInformation = $null
135135
136136 if ($PSCmdlet.ParameterSetName -like ' ByName*' ) {
137137 # Only pass ServerUri if explicitly specified, otherwise let Get-PatCollection use default server with auth
138- $getParams = @ {
138+ $getParameters = @ {
139139 CollectionName = $CollectionName
140140 ErrorAction = ' Stop'
141141 }
142- if ($script :serverContext.WasExplicitUri ) { $getParams [' ServerUri' ] = $effectiveUri }
142+ if ($script :serverContext.WasExplicitUri ) { $getParameters [' ServerUri' ] = $effectiveUri }
143143 if ($LibraryName ) {
144- $getParams [' LibraryName' ] = $LibraryName
144+ $getParameters [' LibraryName' ] = $LibraryName
145145 }
146146 else {
147- $getParams [' LibraryId' ] = $LibraryId
147+ $getParameters [' LibraryId' ] = $LibraryId
148148 }
149149
150- $collection = Get-PatCollection @getParams
150+ $collection = Get-PatCollection @getParameters
151151 if (-not $collection ) {
152152 $libDesc = if ($LibraryName ) { " library '$LibraryName '" } else { " library $LibraryId " }
153153 throw " No collection found with name '$CollectionName ' in $libDesc "
154154 }
155155 $resolvedId = $collection.CollectionId
156- $collectionInfo = $collection
156+ $collectionInformation = $collection
157157 }
158158 else {
159159 try {
160160 # Only pass ServerUri if explicitly specified, otherwise let Get-PatCollection use default server with auth
161- $getParams = @ { CollectionId = $CollectionId ; ErrorAction = ' Stop' }
162- if ($script :serverContext.WasExplicitUri ) { $getParams [' ServerUri' ] = $effectiveUri }
163- $collectionInfo = Get-PatCollection @getParams
161+ $getParameters = @ { CollectionId = $CollectionId ; ErrorAction = ' Stop' }
162+ if ($script :serverContext.WasExplicitUri ) { $getParameters [' ServerUri' ] = $effectiveUri }
163+ $collectionInformation = Get-PatCollection @getParameters
164164 }
165165 catch {
166166 Write-Verbose " Could not retrieve collection info for ID $CollectionId "
@@ -182,8 +182,8 @@ function Add-PatCollectionItem {
182182 return
183183 }
184184
185- $collectionDesc = if ($collectionInfo ) {
186- " '$ ( $collectionInfo .Title ) '"
185+ $collectionDesc = if ($collectionInformation ) {
186+ " '$ ( $collectionInformation .Title ) '"
187187 }
188188 else {
189189 " Collection $resolvedId "
@@ -212,9 +212,9 @@ function Add-PatCollectionItem {
212212
213213 if ($PassThru ) {
214214 # Only pass ServerUri if explicitly specified
215- $getParams = @ { CollectionId = $resolvedId ; ErrorAction = ' Stop' }
216- if ($script :serverContext.WasExplicitUri ) { $getParams [' ServerUri' ] = $effectiveUri }
217- Get-PatCollection @getParams
215+ $getParameters = @ { CollectionId = $resolvedId ; ErrorAction = ' Stop' }
216+ if ($script :serverContext.WasExplicitUri ) { $getParameters [' ServerUri' ] = $effectiveUri }
217+ Get-PatCollection @getParameters
218218 }
219219 }
220220 catch {
0 commit comments