tag:blogger.com,1999:blog-25845959.post1641032554193769622..comments2023-09-25T01:37:24.497-07:00Comments on Saliya's Blogs: Notes on Windows PowerShellSaliya Ekanayakehttp://www.blogger.com/profile/10281589417412608237noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-25845959.post-14280315921609431362013-04-12T21:35:33.693-07:002013-04-12T21:35:33.693-07:00Aha! IIRC "creepy" was since I ran into ...Aha! IIRC "creepy" was since I ran into a seemingly nothing wrong, but didn't quite work situation when handling environment variables.<br /><br />$env:PATH would add Powershell's path (C:\Windows\system32\WindowsPowerShell\v1.0\) by itself (I mean it was not set in PATH variable's value when you open Environment Variables GUI from System Properties). I was using this in a setup script that'll take the current PATH and add Java bin directory to it. The problem was that every time someone ran setup it'll grow unnecessarily. <br /><br />I could solve this, without doing any text manipulation, by using [Environment]::GetEnvironmentVariable("PATH",2)<br /><br />Another minor issue was when using setx to set variables it had a 1024 character limit, which too was solved with [Environment]::SetEnvironmentVariable("Path","$tmp",2) syntax.<br /><br /><br />On how to make it less creepy, I'd say perhaps some notes on such automatic behaviors of commands.<br /><br />Anyway, in the end the experience was worth it as I could automate the somewhat complicated setup of Map Reduce framework, Twister (http://www.iterativemapreduce.org/), on Windows HPC without having to end up a graphical wizard :)<br /><br />Saliya Ekanayakehttps://www.blogger.com/profile/10281589417412608237noreply@blogger.comtag:blogger.com,1999:blog-25845959.post-15833170269446857162013-03-10T17:04:38.553-07:002013-03-10T17:04:38.553-07:00Say more about PowerShell being "creepy"...Say more about PowerShell being "creepy". <br />What does that mean? <br />How could we make it less creepy?<br /><br />Jeffrey Snover[MSFT]<br />Distinguished Engineer and Lead Architect for Windows Serverjsnoverhttps://www.blogger.com/profile/14175711871133375697noreply@blogger.com