[PowerShell]
Le
Senhon

Bonjour,
je suis néophyte. après recherche je n'arrive pas à trouver comment,
avec PowerShell, obtenir le nom du fichier de script en cours d'exécution.
Merci
je suis néophyte. après recherche je n'arrive pas à trouver comment,
avec PowerShell, obtenir le nom du fichier de script en cours d'exécution.
Merci
L'objet $MyInvocation possède une série de propriétés très utiles à cet
usage. Ex: $MyInvocation.mycommand.Definition.
--
Marc Lognoul [MCSE, MCTS, MVP]
Heureux celui qui a pu pénétrer les causes secrètes des choses
Happy is the one who could enter the secret causes of things
Blog EN: http://www.marc-antho-etc.net/blog/
Blog FR: http://www.marc-antho-etc.net/blogfr/
"Senhon" news:4ab9e10e$0$31413$
Petite fonction très pratique:
function Get-Script
{
if($myInvocation.ScriptName) { $myInvocation.ScriptName }
else { $myInvocation.MyCommand.Definition }
}
--
Marc Lognoul [MCSE, MCTS, MVP]
Heureux celui qui a pu pénétrer les causes secrètes des choses
Happy is the one who could enter the secret causes of things
Blog EN: http://www.marc-antho-etc.net/blog/
Blog FR: http://www.marc-antho-etc.net/blogfr/
"Senhon" news:4ab9e10e$0$31413$
Merci, c'est impec.