Skip to content

Commit 8e01d5e

Browse files
Microsoft Graph DevX ToolingMicrosoft Graph DevX Tooling
authored andcommitted
Added try-catch
1 parent d65bf73 commit 8e01d5e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tools/GenerateServiceModule.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ $ModuleConfig = Join-Path $ModulePath "\$Module.md"
4343
Copy-ModuleTemplate -Destination $ModuleConfig -TemplatePath (Join-Path $TemplatePath "module.md") -ModuleName $Module
4444
#Clear autorest temp folder
4545
$TempPath = "C:\Users\CLOUDT~1\AppData\Local\Temp\"
46-
Get-ChildItem -Path $TempPath -Recurse -Force | Remove-Item -Recurse -Force
46+
try {
47+
Get-ChildItem -Path $TempPath -Recurse -Force | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
48+
} catch {
49+
Write-Host $_.Exception.Message
50+
}
4751
$ApiVersion | ForEach-Object {
4852
$CurrentApiVersion = $_
4953
$OpenApiFile = Join-Path $OpenApiPath $CurrentApiVersion "$Module.yml"

0 commit comments

Comments
 (0)