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

Interoperability: QuoteName | Get-Path #6

Open
petervandivier opened this issue Jul 19, 2018 · 0 comments
Open

Interoperability: QuoteName | Get-Path #6

petervandivier opened this issue Jul 19, 2018 · 0 comments

Comments

@petervandivier
Copy link
Member

Objects that get a quoted name from the DB may pass the quoted name onto downstream references. Regex -replace "[\[\]]" use may be required for successful parsing

$objs = (
    "object.with.[Quote Name Required]",
    "object.with.[Quote Name Required 2]"
) | ForEach-Object {
    $d = $_.Split(".")[0]
    $s = $_.Split(".")[1]
    $o = $_.Split(".")[2]

    Get-SqlObject -server "localhost" -database $d -schema $s -object $o
}

$objs | ForEach-Object {
    $fp = Get-SqlObjFilePath `
        -project default `
        -Database $_.database `
        -schema $_.schema `
        -name ($_.name -replace "[\[\]]")`
        -type $_.base_type 
    
    $fp.fullPath
    Test-Path $fp.fullPath
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant