{"id":1940,"date":"2015-12-24T23:32:44","date_gmt":"2015-12-24T22:32:44","guid":{"rendered":"http:\/\/www.yanael.com\/?p=1940"},"modified":"2015-12-27T10:36:24","modified_gmt":"2015-12-27T09:36:24","slug":"modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier","status":"publish","type":"post","link":"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/","title":{"rendered":"Modifier Prompt Powershell – Fonction pour ajouter dossier \/ sous dossier"},"content":{"rendered":"

Un bout de code int\u00e9ressant, voir indispensable \ud83d\ude09<\/p>\n

[codesyntax lang=”powershell”]<\/p>\n

function prompt {\r\n $cwd = (get-location).Path<\/pre>\n

[array]$cwdt=$()
\n$cwdi=-1
\ndo {
\n$cwdi=$cwd.indexofany(\u201d\\\\\u201d,$cwdi+1)
\n[array]$cwdt+=$cwdi} until($cwdi -eq -1)<\/p>\n

if ($cwdt.count -gt 3) {
\n$cwd = $cwd.substring(0,$cwdt[0]) + \u201c\\..\u201d + $cwd.substring($cwdt[$cwdt.count-3])
\n}<\/p>\n

\u201d $cwd>_ \u201d
\n}
\n# The above sets prompt to the current drive letter, immediate sub directory and current directory.
\n#\u00a0\u00a0\u00a0\u00a0 Example: C:\\..\\drivers\\etc>_<\/p>\n

Import-Module Pscx #-arg ~\\Pscx.UserPreferences.ps1<\/p>\n

[\/codesyntax]<\/p>\n \n","protected":false},"excerpt":{"rendered":"

Un bout de code int\u00e9ressant, voir indispensable \ud83d\ude09 [codesyntax lang=”powershell”] function prompt { $cwd = (get-location).Path [array]$cwdt=$() $cwdi=-1 do { $cwdi=$cwd.indexofany(\u201d\\\\\u201d,$cwdi+1) [array]$cwdt+=$cwdi} until($cwdi -eq -1) if ($cwdt.count -gt 3) { $cwd = $cwd.substring(0,$cwdt[0]) + \u201c\\..\u201d + $cwd.substring($cwdt[$cwdt.count-3]) } \u201d $cwd>_ \u201d } # The above sets prompt to the current drive letter, immediate sub directory […]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[4,203,202],"tags":[144,310,309,206,308,240],"yoast_head":"\nModifier Prompt Powershell - Fonction pour ajouter dossier \/ sous dossier | Tranches de Veek<\/title>\n<meta name=\"description\" content=\"Un bout de code int\u00e9ressant, voir indispensable ;) function prompt { $cwd = (get-location).Path $cwdt=$() $cwdi=-1 do {\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Modifier Prompt Powershell - Fonction pour ajouter dossier \/ sous dossier | Tranches de Veek\" \/>\n<meta name=\"twitter:description\" content=\"Un bout de code int\u00e9ressant, voir indispensable ;) function prompt { $cwd = (get-location).Path $cwdt=$() $cwdi=-1 do {\" \/>\n<meta name=\"twitter:creator\" content=\"@ari0k\" \/>\n<meta name=\"twitter:site\" content=\"@ari0k\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"ari0k\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/\"},\"author\":{\"name\":\"ari0k\",\"@id\":\"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/9e29ebede3b1978adbfcf2d0af50a879\"},\"headline\":\"Modifier Prompt Powershell – Fonction pour ajouter dossier \/ sous dossier\",\"datePublished\":\"2015-12-24T22:32:44+00:00\",\"dateModified\":\"2015-12-27T09:36:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/\"},\"wordCount\":79,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/aba6b325d853c0a1a94f3542c487c6d7\"},\"keywords\":[\"console\",\"dir\",\"path\",\"powershell\",\"prompt\",\"script\"],\"articleSection\":[\"Informatique\",\"Powershell\",\"Scripts\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/\",\"url\":\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/\",\"name\":\"Modifier Prompt Powershell - Fonction pour ajouter dossier \/ sous dossier | Tranches de Veek\",\"isPartOf\":{\"@id\":\"http:\/\/www.yanael.com\/wp\/#website\"},\"datePublished\":\"2015-12-24T22:32:44+00:00\",\"dateModified\":\"2015-12-27T09:36:24+00:00\",\"description\":\"Un bout de code int\u00e9ressant, voir indispensable ;) function prompt { $cwd = (get-location).Path $cwdt=$() $cwdi=-1 do {\",\"breadcrumb\":{\"@id\":\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"http:\/\/www.yanael.com\/wp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Modifier Prompt Powershell – Fonction pour ajouter dossier \/ sous dossier\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.yanael.com\/wp\/#website\",\"url\":\"http:\/\/www.yanael.com\/wp\/\",\"name\":\"Tranches de Veek\",\"description\":\"404 - C'est comme la vie, mais en plus Geek !\",\"publisher\":{\"@id\":\"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/aba6b325d853c0a1a94f3542c487c6d7\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.yanael.com\/wp\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"fr-FR\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/aba6b325d853c0a1a94f3542c487c6d7\",\"name\":\"ari0k\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8ce11527add5c4c8a0afb43e6cf75917?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8ce11527add5c4c8a0afb43e6cf75917?s=96&d=retro&r=g\",\"caption\":\"ari0k\"},\"logo\":{\"@id\":\"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.yanael.com\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/9e29ebede3b1978adbfcf2d0af50a879\",\"name\":\"ari0k\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2c51ca3338c41882e80fc5a17ad72e9b?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2c51ca3338c41882e80fc5a17ad72e9b?s=96&d=retro&r=g\",\"caption\":\"ari0k\"},\"sameAs\":[\"http:\/\/yanael.com\",\"tranches.de.veek\",\"https:\/\/twitter.com\/ari0k\"],\"url\":\"https:\/\/www.yanael.com\/wp\/author\/ari0k\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Modifier Prompt Powershell - Fonction pour ajouter dossier \/ sous dossier | Tranches de Veek","description":"Un bout de code int\u00e9ressant, voir indispensable ;) function prompt { $cwd = (get-location).Path $cwdt=$() $cwdi=-1 do {","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/","twitter_card":"summary_large_image","twitter_title":"Modifier Prompt Powershell - Fonction pour ajouter dossier \/ sous dossier | Tranches de Veek","twitter_description":"Un bout de code int\u00e9ressant, voir indispensable ;) function prompt { $cwd = (get-location).Path $cwdt=$() $cwdi=-1 do {","twitter_creator":"@ari0k","twitter_site":"@ari0k","twitter_misc":{"\u00c9crit par":"ari0k"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/#article","isPartOf":{"@id":"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/"},"author":{"name":"ari0k","@id":"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/9e29ebede3b1978adbfcf2d0af50a879"},"headline":"Modifier Prompt Powershell – Fonction pour ajouter dossier \/ sous dossier","datePublished":"2015-12-24T22:32:44+00:00","dateModified":"2015-12-27T09:36:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/"},"wordCount":79,"commentCount":0,"publisher":{"@id":"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/aba6b325d853c0a1a94f3542c487c6d7"},"keywords":["console","dir","path","powershell","prompt","script"],"articleSection":["Informatique","Powershell","Scripts"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/","url":"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/","name":"Modifier Prompt Powershell - Fonction pour ajouter dossier \/ sous dossier | Tranches de Veek","isPartOf":{"@id":"http:\/\/www.yanael.com\/wp\/#website"},"datePublished":"2015-12-24T22:32:44+00:00","dateModified":"2015-12-27T09:36:24+00:00","description":"Un bout de code int\u00e9ressant, voir indispensable ;) function prompt { $cwd = (get-location).Path $cwdt=$() $cwdi=-1 do {","breadcrumb":{"@id":"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.yanael.com\/wp\/modifier-prompt-powershell-fonction-pour-ajouter-dossier-sous-dossier-1940\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"http:\/\/www.yanael.com\/wp\/"},{"@type":"ListItem","position":2,"name":"Modifier Prompt Powershell – Fonction pour ajouter dossier \/ sous dossier"}]},{"@type":"WebSite","@id":"http:\/\/www.yanael.com\/wp\/#website","url":"http:\/\/www.yanael.com\/wp\/","name":"Tranches de Veek","description":"404 - C'est comme la vie, mais en plus Geek !","publisher":{"@id":"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/aba6b325d853c0a1a94f3542c487c6d7"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.yanael.com\/wp\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"fr-FR"},{"@type":["Person","Organization"],"@id":"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/aba6b325d853c0a1a94f3542c487c6d7","name":"ari0k","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8ce11527add5c4c8a0afb43e6cf75917?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8ce11527add5c4c8a0afb43e6cf75917?s=96&d=retro&r=g","caption":"ari0k"},"logo":{"@id":"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.yanael.com"]},{"@type":"Person","@id":"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/9e29ebede3b1978adbfcf2d0af50a879","name":"ari0k","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"http:\/\/www.yanael.com\/wp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2c51ca3338c41882e80fc5a17ad72e9b?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2c51ca3338c41882e80fc5a17ad72e9b?s=96&d=retro&r=g","caption":"ari0k"},"sameAs":["http:\/\/yanael.com","tranches.de.veek","https:\/\/twitter.com\/ari0k"],"url":"https:\/\/www.yanael.com\/wp\/author\/ari0k\/"}]}},"_links":{"self":[{"href":"https:\/\/www.yanael.com\/wp\/wp-json\/wp\/v2\/posts\/1940"}],"collection":[{"href":"https:\/\/www.yanael.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yanael.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yanael.com\/wp\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yanael.com\/wp\/wp-json\/wp\/v2\/comments?post=1940"}],"version-history":[{"count":0,"href":"https:\/\/www.yanael.com\/wp\/wp-json\/wp\/v2\/posts\/1940\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yanael.com\/wp\/wp-json\/wp\/v2\/media?parent=1940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yanael.com\/wp\/wp-json\/wp\/v2\/categories?post=1940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yanael.com\/wp\/wp-json\/wp\/v2\/tags?post=1940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}