{"id":2109,"date":"2019-03-15T14:34:24","date_gmt":"2019-03-15T13:34:24","guid":{"rendered":"http:\/\/les-fougs.com\/wordpress\/?p=2109"},"modified":"2019-03-15T14:34:24","modified_gmt":"2019-03-15T13:34:24","slug":"la-queue-powershell","status":"publish","type":"post","link":"http:\/\/les-fougs.com\/wordpress\/2019\/03\/15\/la-queue-powershell\/","title":{"rendered":"La Queue Powershell"},"content":{"rendered":"<p>Alors lancer un Powershell (ps1) via VTom ?<\/p>\n<p>Mission &amp; Gal\u00e9re ?<\/p>\n<p>Rassurez vous , pas du tout .<\/p>\n<p>Il vous suffit de cr\u00e9er un queue d\u00e9di\u00e9 pour ce faire (et de la r\u00e9f\u00e9rencer sur votre serveur vtom via votre IHM) :<\/p>\n<p>Je vous conseil de copier une queue wnt existante pour modification cependant voici la queue que je vous propose:<\/p>\n<pre><strong>@echo OFF<\/strong>\r\n\r\n<strong>echo ______________________________________________________________________<\/strong>\r\n <strong>echo Contexte Visual TOM du traitement<\/strong>\r\n <strong>echo.<\/strong>\r\n <strong>echo Machine : %TOM_HOST%<\/strong>\r\n <strong>echo Utilisateur : %TOM_USER%<\/strong>\r\n <strong>echo Script : %TOM_SCRIPT%<\/strong>\r\n <strong>echo Serveur Visual TOM : %TOM_REMOTE_SERVER%<\/strong>\r\n <strong>echo Traitement : %TOM_JOB%<\/strong>\r\n <strong>echo Application : %TOM_APPLICATION%<\/strong>\r\n <strong>echo Environnement : %TOM_ENVIRONMENT%<\/strong>\r\n <strong>echo Job ID : %TOM_JOB_ID%<\/strong>\r\n <strong>echo Mode Execution : %TOM_JOB_EXEC%<\/strong>\r\n <strong>echo Date d\u2019exploitation : %TOM_DATE%<\/strong>\r\n <strong>echo Valeur de la date : %TOM_DATE_VALUE%<\/strong>\r\n <strong>echo Log des erreurs : %TOM_LOG_PATH_E%<\/strong>\r\n <strong>echo Log des sorties : %TOM_LOG_PATH_O%<\/strong>\r\n <strong>echo Action sur les logs : (%TOM_LOG_ACTION%)<\/strong>\r\n <strong>echo Directory des logs : %TOM_LOG_DIR%<\/strong>\r\n <strong>echo _______________________________________________________________________<\/strong>\r\n <strong>echo Debut de l\u2019execution du script \u2026<\/strong>\r\n <strong>date \/T<\/strong>\r\n <strong>time \/T<\/strong>\r\n <strong>echo _______________________________________________________________________<\/strong>\r\n\r\n<strong>echo.<\/strong>\r\n <strong>:argloop<\/strong>\r\n <strong>shift<\/strong>\r\n <strong>if \u00ab %0\u2033== \u00bb \u00bb goto argend<\/strong>\r\n <strong>set arg=%arg% %0<\/strong>\r\n <strong>goto argloop<\/strong>\r\n <strong>:argend<\/strong>\r\n\r\n<strong>call PowerShell.exe -ExecutionPolicy Unrestricted -NonInteractive -File \u00ab %TOM_SCRIPT% \u00bb %arg%<\/strong>\r\n\r\n<strong>set RETCODE=%ERRORLEVEL%<\/strong>\r\n <strong>if %RETCODE% equ 0 goto TERMINE<\/strong>\r\n <strong>goto ERREUR<\/strong>\r\n\r\n<strong>:ERREUR<\/strong>\r\n <strong>%ABM_BIN%\\tsend -sE -r%RETCODE% -m \u00bbJob en erreur (%RETCODE%) \u00bb<\/strong>\r\n <strong>echo _______________________________________________________________________<\/strong>\r\n <strong>echo Fin d\u2019ex\u00e9cution du script<\/strong>\r\n <strong>date \/T<\/strong>\r\n <strong>time \/T<\/strong>\r\n <strong>echo Exit %RETCODE% donc pas d\u2019acquitement<\/strong>\r\n <strong>echo _______________________________________________________________________<\/strong>\r\n <strong>if not \u00ab %TOM_LOG_ACTION% \u00bb== \u00bb \u00bb call Gestlog_wnt.bat<\/strong>\r\n <strong>exit %RETCODE%<\/strong>\r\n\r\n<strong>:TERMINE<\/strong>\r\n <strong>%ABM_BIN%\\tsend -sT -r%RETCODE% -m \u00bbJob termine (%RETCODE%) \u00bb<\/strong>\r\n <strong>echo _______________________________________________________________________<\/strong>\r\n <strong>echo Fin d\u2019ex\u00e9cution du script<\/strong>\r\n <strong>date \/T<\/strong>\r\n <strong>time \/T<\/strong>\r\n <strong>echo Exit 0 donc acquitement<\/strong>\r\n <strong>if not \u00ab %TOM_LOG_ACTION% \u00bb== \u00bb \u00bb call Gestlog_wnt.bat<\/strong>\r\n <strong>exit 0<\/strong><\/pre>\n<p>Cependant dans certain cas il vous faudra peut-\u00eatre pr\u00e9ciser ou se situe votre programme powershell et par cons\u00e9quent indiquer apr\u00e8s la commance call le chemin du programme powershell :<\/p>\n<p>Exemple :<\/p>\n<p>call C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe -ExecutionPolicy Unrestricted -NonInteractive -File \u00ab %TOM_SCRIPT% \u00bb %arg%<\/p>\n<p>Une fois cette queue impl\u00e9ment\u00e9e sur l\u2019agent vtom et une fois cette queue impl\u00e9ment\u00e9 via votre IHM vtom , n\u2019oubliez pas de sp\u00e9cifier \u00e0 votre job d\u2019utiliser cette nouvelle queue Powershell.<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"6zoO9iJxGB\"><p><a href=\"https:\/\/bibliogeek.fr\/2016\/05\/vtom-la-queue-powershell\/\">VTOM : La Queue Powershell<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"https:\/\/bibliogeek.fr\/2016\/05\/vtom-la-queue-powershell\/embed\/#?secret=6zoO9iJxGB\" data-secret=\"6zoO9iJxGB\" width=\"600\" height=\"338\" title=\"&laquo;&nbsp;VTOM : La Queue Powershell&nbsp;&raquo; &#8212; Bibliogeek\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Alors lancer un Powershell (ps1) via VTom ? Mission &amp; Gal\u00e9re ? Rassurez vous , pas du tout . Il vous suffit de cr\u00e9er un queue d\u00e9di\u00e9 pour ce faire (et de la r\u00e9f\u00e9rencer sur votre serveur vtom via votre IHM) : Je vous conseil de copier une queue wnt existante pour modification cependant voici &hellip; <a href=\"http:\/\/les-fougs.com\/wordpress\/2019\/03\/15\/la-queue-powershell\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;La Queue Powershell&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[43],"tags":[],"_links":{"self":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/2109"}],"collection":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2109"}],"version-history":[{"count":1,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/2109\/revisions"}],"predecessor-version":[{"id":2110,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/2109\/revisions\/2110"}],"wp:attachment":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2109"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}