{"id":759,"date":"2018-07-13T09:50:38","date_gmt":"2018-07-13T07:50:38","guid":{"rendered":"https:\/\/www.tests-performance.fr\/?p=759"},"modified":"2018-07-25T13:52:13","modified_gmt":"2018-07-25T11:52:13","slug":"connexion-alm-qc-pc-avec-powershell","status":"publish","type":"post","link":"https:\/\/www.tests-performance.fr\/?p=759","title":{"rendered":"Connexion ALM QC-PC avec PowerShell"},"content":{"rendered":"<div dir=\"ltr\">L&#8217;automatisation de t\u00e2ches de gestion dans\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_934885049451531468199912\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_934885049451531468199912\" data-ephox-cram-annotation=\"ALM\" data-ephox-cram-lingo=\"fr\">ALM<\/span>\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_876376137461531468199912\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_876376137461531468199912\" data-ephox-cram-annotation=\"QC-PC\" data-ephox-cram-lingo=\"fr\">QC-PC<\/span>\u00a0via\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_130239078471531468199912\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_130239078471531468199912\" data-ephox-cram-annotation=\"Powershell\" data-ephox-cram-lingo=\"fr\">Powershell<\/span>\u00a0est possible, mais il est convient de respecter la proc\u00e9dure suivante. Pour\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_617936776481531468199912\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_617936776481531468199912\" data-ephox-cram-annotation=\"info\" data-ephox-cram-lingo=\"fr\">info<\/span>, cette proc\u00e9dure n&#8217;existe actuellement pas le net. Le programme ci-dessous active un projet\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_349102835491531468199912\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_349102835491531468199912\" data-ephox-cram-annotation=\"ALM\" data-ephox-cram-lingo=\"fr\">ALM<\/span>\u00a0si celui-ci n&#8217;est pas activ\u00e9.<\/div>\n<div dir=\"ltr\">Pour autoriser\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_855974257501531468200066\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_855974257501531468200066\" data-ephox-cram-annotation=\"l'\u00e9x\u00e9cution\" data-ephox-cram-lingo=\"fr\">l&#8217;\u00e9x\u00e9cution<\/span>\u00a0des scripts sign\u00e9s ou pas dans\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_97151214511531468200066\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_97151214511531468200066\" data-ephox-cram-annotation=\"Powershell\" data-ephox-cram-lingo=\"fr\">Powershell<\/span>, il est n\u00e9cessaire de lancer dans\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_391487262521531468200066\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_391487262521531468200066\" data-ephox-cram-annotation=\"Powershell\" data-ephox-cram-lingo=\"fr\">Powershell<\/span>\u00a0:\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_687103819531531468200066\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_687103819531531468200066\" data-ephox-cram-annotation=\"set-executionpolicy\" data-ephox-cram-lingo=\"fr\">set-executionpolicy<\/span>\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_897496626541531468200066\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_897496626541531468200066\" data-ephox-cram-annotation=\"remotesigned\" data-ephox-cram-lingo=\"fr\">remotesigned<\/span><\/div>\n<div dir=\"ltr\">Lancer le script via invite de commande :\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_741425217551531468200220\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_741425217551531468200220\" data-ephox-cram-annotation=\"powershell\" data-ephox-cram-lingo=\"fr\">powershell<\/span>\u00a0-File &#8220;<span class=\"ephox-cram-annotation-wrap ephox-cram_725371733561531468200220\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_725371733561531468200220\" data-ephox-cram-annotation=\"ActivateProjet\" data-ephox-cram-lingo=\"fr\">ActivateProjet<\/span>.ps1&#8243;<\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\"># Chargement des\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_816906614581531468200422\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_816906614581531468200422\" data-ephox-cram-annotation=\"Assembly\" data-ephox-cram-lingo=\"fr\">Assembly<\/span>\u00a0n\u00e9cessaires \u00e0 l&#8217;utilisation des classes de connexion<\/div>\n<div dir=\"ltr\">[<span class=\"ephox-cram-annotation-wrap ephox-cram_988489471611531468200646\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_988489471611531468200646\" data-ephox-cram-annotation=\"Reflection\" data-ephox-cram-lingo=\"fr\">Reflection<\/span>.<span class=\"ephox-cram-annotation-wrap ephox-cram_685048738621531468200646\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_685048738621531468200646\" data-ephox-cram-annotation=\"Assembly\" data-ephox-cram-lingo=\"fr\">Assembly<\/span>]::<span class=\"ephox-cram-annotation-wrap ephox-cram_954324394631531468200646\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_954324394631531468200646\" data-ephox-cram-annotation=\"LoadFile\" data-ephox-cram-lingo=\"fr\">LoadFile<\/span>(&#8220;D:\\Sources\\\\<span class=\"ephox-cram-annotation-wrap ephox-cram_992281454641531468200646\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_992281454641531468200646\" data-ephox-cram-annotation=\"Interop\" data-ephox-cram-lingo=\"fr\">Interop<\/span>.<span class=\"ephox-cram-annotation-wrap ephox-cram_355524843651531468200646\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_355524843651531468200646\" data-ephox-cram-annotation=\"TDAPIOLELib\" data-ephox-cram-lingo=\"fr\">TDAPIOLELib<\/span>.<span class=\"ephox-cram-annotation-wrap ephox-cram_892066541661531468200646\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_892066541661531468200646\" data-ephox-cram-annotation=\"dll\" data-ephox-cram-lingo=\"fr\">dll<\/span>&#8220;) |\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_699809333671531468200646\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_699809333671531468200646\" data-ephox-cram-annotation=\"out-null\" data-ephox-cram-lingo=\"fr\">out-null<\/span><\/div>\n<div dir=\"ltr\">[<span class=\"ephox-cram-annotation-wrap ephox-cram_719153795881531468200673\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_719153795881531468200673\" data-ephox-cram-annotation=\"Reflection\" data-ephox-cram-lingo=\"fr\">Reflection<\/span>.<span class=\"ephox-cram-annotation-wrap ephox-cram_966532697891531468200673\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_966532697891531468200673\" data-ephox-cram-annotation=\"Assembly\" data-ephox-cram-lingo=\"fr\">Assembly<\/span>]::<span class=\"ephox-cram-annotation-wrap ephox-cram_262357222901531468200673\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_262357222901531468200673\" data-ephox-cram-annotation=\"LoadFile\" data-ephox-cram-lingo=\"fr\">LoadFile<\/span>(&#8220;D:\\Sources\\\\<span class=\"ephox-cram-annotation-wrap ephox-cram_565268251911531468200673\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_565268251911531468200673\" data-ephox-cram-annotation=\"Interop\" data-ephox-cram-lingo=\"fr\">Interop<\/span>.<span class=\"ephox-cram-annotation-wrap ephox-cram_420258867991531468200776\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_420258867991531468200776\" data-ephox-cram-annotation=\"SACLIENTLib\" data-ephox-cram-lingo=\"fr\">SACLIENTLib<\/span>.<span class=\"ephox-cram-annotation-wrap ephox-cram_139864188921531468200673\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_139864188921531468200673\" data-ephox-cram-annotation=\"dll\" data-ephox-cram-lingo=\"fr\">dll<\/span>&#8220;) |\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_921612189931531468200673\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_921612189931531468200673\" data-ephox-cram-annotation=\"out-null\" data-ephox-cram-lingo=\"fr\">out-null<\/span><\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\">$<span class=\"ephox-cram-annotation-wrap ephox-cram_1648075421021531468201005\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_1648075421021531468201005\" data-ephox-cram-annotation=\"td\" data-ephox-cram-lingo=\"fr\">td<\/span>\u00a0=\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_7719503991031531468201005\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_7719503991031531468201005\" data-ephox-cram-annotation=\"New-Object\" data-ephox-cram-lingo=\"fr\">New-Object<\/span>\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_2317073781041531468201005\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_2317073781041531468201005\" data-ephox-cram-annotation=\"-ComObject\" data-ephox-cram-lingo=\"fr\">-ComObject<\/span>\u00a0TDApiOle80.<span class=\"ephox-cram-annotation-wrap ephox-cram_5470562071051531468201005\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_5470562071051531468201005\" data-ephox-cram-annotation=\"TDConnection\" data-ephox-cram-lingo=\"fr\">TDConnection<\/span><\/div>\n<div dir=\"ltr\">$<span class=\"ephox-cram-annotation-wrap ephox-cram_1953486351061531468201184\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_1953486351061531468201184\" data-ephox-cram-annotation=\"almsa\" data-ephox-cram-lingo=\"fr\">almsa<\/span>\u00a0=\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_4540074821071531468201184\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_4540074821071531468201184\" data-ephox-cram-annotation=\"New-Object\" data-ephox-cram-lingo=\"fr\">New-Object<\/span>\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_7302360051081531468201184\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_7302360051081531468201184\" data-ephox-cram-annotation=\"SACLIENTLib\" data-ephox-cram-lingo=\"fr\">SACLIENTLib<\/span>.<span class=\"ephox-cram-annotation-wrap ephox-cram_956133241091531468201184\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_956133241091531468201184\" data-ephox-cram-annotation=\"SAapiClass\" data-ephox-cram-lingo=\"fr\">SAapiClass<\/span><\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\">$qualityCenterLink = &#8220;http:\/\/&lt;SERVER&gt;:8080\/qcbin&#8221;<\/div>\n<div dir=\"ltr\">$qualityCenterDomain = &#8220;DEFAULT&#8221;<\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\"># Saisie Password et Nom Projet<\/div>\n<div dir=\"ltr\">$qualityCenterProject=Read-Host &#8220;quality Center Project&#8221;<\/div>\n<div dir=\"ltr\">$qualityCenterUsername = Read-Host &#8220;quality Center User&#8221;<\/div>\n<div dir=\"ltr\">$qualityCenterPassword=Read-Host &#8220;quality Center Password&#8221;<\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\"># Connexion\u00a0<span class=\"ephox-cram-annotation-wrap ephox-cram_138772412941531468200678\" aria-invalid=\"spelling\" data-ephox-cram-highlight-id=\"ephox-cram_138772412941531468200678\" data-ephox-cram-annotation=\"ALM\" data-ephox-cram-lingo=\"fr\">ALM<\/span>\u00a0PC<\/div>\n<div dir=\"ltr\">$td.InitConnectionEx($qualityCenterLink)<\/div>\n<div dir=\"ltr\">$td.Login($qualityCenterUsername, $qualityCenterPassword)<\/div>\n<div dir=\"ltr\">$almsa.Login($qualityCenterLink, $qualityCenterUsername, $qualityCenterPassword)<\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\">[System.XML.XMLDocument]$Doc = New-Object System.Xml.XmlDocument<\/div>\n<div dir=\"ltr\">$Doc.LoadXml($almsa.GetDomain($qualityCenterDomain))<\/div>\n<div dir=\"ltr\">#Write-Host &#8220;Doc : &#8221; $Doc.OuterXml<\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\">#[System.XML.XmlNode]$ProjectList = $Doc.DocumentElement.SelectSingleNode(&#8220;PROJECTS_LIST&#8221;)<\/div>\n<div dir=\"ltr\">#Write-Host &#8220;ProjectList : &#8221; $ProjectList.OuterXml<\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\">$node1 = $Doc.SelectNodes(&#8220;GetDomain\/PROJECTS_LIST\/TDXItem&#8221;)<\/div>\n<div dir=\"ltr\">#Write-Host $node1.Count<\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\">ForEach ($Project in $node1) {<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 $Projet = $Project.SelectSingleNode(&#8220;PROJECT_NAME&#8221;).InnerText<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 Write-Host &#8220;Projet : &#8221; $Projet<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 $ProjetActive = $Project.SelectSingleNode(&#8220;PR_IS_ACTIVE&#8221;).InnerText<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 Write-Host &#8220;ProjetActive : &#8221; $ProjetActive<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 if ($ProjetActive -eq &#8220;N&#8221;) {<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 \u00a0$almsa.ActivateProject($qualityCenterDomain, $qualityCenterProject)<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 \u00a0Write-Host &#8220;Projet&#8221; $qualityCenterProject &#8220;activ\u00e9 !&#8221;<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 } else {<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 \u00a0Write-Host &#8220;Projet d\u00e9j\u00e0 activ\u00e9&#8221;<\/div>\n<div dir=\"ltr\">\u00a0 \u00a0 }<\/div>\n<div dir=\"ltr\">}<\/div>\n<div dir=\"ltr\">$td.Disconnect()<\/div>\n<div dir=\"ltr\">$td.Logout()<\/div>\n<div dir=\"ltr\">$almsa.Logout()<\/div>\n","protected":false},"excerpt":{"rendered":"<p>L&#8217;automatisation de t\u00e2ches de gestion dans\u00a0ALM\u00a0QC-PC\u00a0via\u00a0Powershell\u00a0est possible, mais il est convient de respecter la proc\u00e9dure suivante. Pour\u00a0info, cette proc\u00e9dure n&#8217;existe actuellement pas le net. Le programme ci-dessous active un projet\u00a0ALM\u00a0si celui-ci n&#8217;est pas activ\u00e9. Pour autoriser\u00a0l&#8217;\u00e9x\u00e9cution\u00a0des scripts sign\u00e9s ou pas dans\u00a0Powershell, il est n\u00e9cessaire de lancer dans\u00a0Powershell\u00a0:\u00a0set-executionpolicy\u00a0remotesigned Lancer le script via invite de commande :\u00a0powershell\u00a0-File [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[27],"class_list":["post-759","post","type-post","status-publish","format-standard","hentry","category-performance-center","tag-tests-de-performance"],"acf":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=\/wp\/v2\/posts\/759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=759"}],"version-history":[{"count":4,"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=\/wp\/v2\/posts\/759\/revisions"}],"predecessor-version":[{"id":1167,"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=\/wp\/v2\/posts\/759\/revisions\/1167"}],"wp:attachment":[{"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tests-performance.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}