Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/BuildScripts/BuildScripts.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ function Update-GeneratedSubModule {
$formatName = Get-ChildItem $SourceDirectory | Where-Object { $_.Name -match "Az\.${subModuleNameTrimmed}\.format\.ps1xml" } | Foreach-Object {$_.Name}
$csprojName = Get-ChildItem $SourceDirectory | Where-Object { $_.Name -match "Az\.${subModuleNameTrimmed}\.csproj" } | Foreach-Object {$_.Name}
$fileToUpdate = @('generated', 'resources', $psd1Name, $psm1Name, $formatName, 'exports', 'internal', 'test-module.ps1', 'check-dependencies.ps1')
# Copy from src/ to generated/
# Move from src/ to generated/
$fileToUpdate | Foreach-Object {
$moveFrom = Join-Path $SourceDirectory $_
$moveTo = Join-Path $GeneratedDirectory $_
Write-Host "Copying $moveFrom to $moveTo ..." -ForegroundColor Cyan
Copy-Item -Path $moveFrom -Destination $moveTo -Recurse -Force
Write-Host "Moving $moveFrom to $moveTo ..." -ForegroundColor Cyan
Move-Item -Path $moveFrom -Destination $moveTo -Force
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Move-Item operation should include the -Recurse parameter when moving directories to ensure all subdirectories and files are moved properly. The 'generated' item in the $fileToUpdate array appears to be a directory based on the context.

Suggested change
Move-Item -Path $moveFrom -Destination $moveTo -Force
Move-Item -Path $moveFrom -Destination $moveTo -Force -Recurse

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

@VeryEarly VeryEarly Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, Move-Item is recursive by default and there is no parameter -Recurse in Move-Item. Please be smart @copilot

}
$cSubModuleNameTrimmed = $subModuleNameTrimmed
if ($csprojName -match "^Az\.(?<cSubModuleName>\w+)\.csproj$") {
Expand Down
Loading