Created
September 10, 2014 16:53
-
-
Save ritalin/c9b9cfe58222c1756735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test(){ | |
get-pscallstack | select -skip 1 -first 1 | %{ | |
if ([io.path]::GetExtension($_.ScriptName) -eq ".psm1") { | |
if (test-path "$($_.ScriptName).config") { | |
[xml](Get-Content "$($_.ScriptName).config") | |
} | |
elseif (test-path "$($_.ScriptName).json") { | |
[string]::join('', (Get-Content "$($_.ScriptName).json")) | ConvertFrom-Json | |
} | |
else { | |
@{} | |
} | |
} | |
else { | |
@{} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment