Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-AzDomainInfo throwing Illegal characters in path. #34

Open
Flangyver opened this issue Dec 14, 2023 · 0 comments
Open

Get-AzDomainInfo throwing Illegal characters in path. #34

Flangyver opened this issue Dec 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Flangyver
Copy link

After running Get-AzDomainInfo -verbose I received an Illegal characters in path error for every time Get-AzDomainInfo tried to write any output:
image
This is because the subscription has pipes | in it's name and those are illegal characters for a folder name. To fix my issue I edited lines 173-176 of Get-AzDomainInfo.ps1 to the following code:

    $folderSubscription = $Subscription.replace('|','-')
    if(Test-Path $folder"\"$folderSubscription){}
    else{New-Item -ItemType Directory $folder"\"$folderSubscription | Out-Null}
    
    $folder = -join ($folder, "\", $folderSubscription)

Probably a better solution to catch all Illegal characters is remove any characters from [System.IO.Path]::GetInvalidFileNameChars() -join '' out of the folder name to prevent this issue in the future.

@kfosaaen kfosaaen added the bug Something isn't working label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants