Computers - Software Hardware : Windows Powershell

Discussion in 'Science and Technology' started by Shikamaru, Oct 15, 2012.

  1. Shikamaru

    Shikamaru Well-Known Member MEMBER

    Country:
    United States
    Joined:
    May 7, 2011
    Messages:
    3,486
    Likes Received:
    1,965
    Gender:
    Male
    Ratings:
    +1,989
    Microsoft Technet: Windows Powershell

    Wikipedia: Powershell

    Powershell is absolutely incredible. I'm a fan of the *nixes, but *nix has no equivalent language to this yet.

    When you can intermix programming language code (like C#.NET or VB.NET) with your scripting (Powershell), that's insane.
     
  2. Gorilla

    Gorilla Well-Known Member MEMBER

    Country:
    United States
    Joined:
    Jan 31, 2009
    Messages:
    2,479
    Likes Received:
    1,382
    Gender:
    Male
    Ratings:
    +1,399
    Powershell is pretty useful if you have to operate on the MS stack, but it is kind of amusing how much time and effort is spent basically re-inventing Unix.
     
  3. Shikamaru

    Shikamaru Well-Known Member MEMBER

    Country:
    United States
    Joined:
    May 7, 2011
    Messages:
    3,486
    Likes Received:
    1,965
    Gender:
    Male
    Ratings:
    +1,989
    Powershell is different.

    In traditional *nix, everything is treated as file.
    In Powershell, everything is treated as an object.

    This is huge. You can intermix your programming skills with traditional scripting.
     
  4. Gorilla

    Gorilla Well-Known Member MEMBER

    Country:
    United States
    Joined:
    Jan 31, 2009
    Messages:
    2,479
    Likes Received:
    1,382
    Gender:
    Male
    Ratings:
    +1,399
    Everything is technically a file descriptor which are objects. I swear I didn't just make that up...I realize how crazy that sounds.

    If i recall correctly, the design principles are the same in a lot of places (which is a compliment to both things, imho) and a lot of the aliases that are set up to be Unix like perform the same functions because the design makes it relatively trivial to do so.
     
  5. houserunner

    houserunner Well-Known Member MEMBER

    Country:
    United States
    Joined:
    Feb 12, 2010
    Messages:
    1,070
    Likes Received:
    1,154
    Gender:
    Male
    Ratings:
    +1,167
    I utilize the Exchange Shell extensively.
     
  6. Shikamaru

    Shikamaru Well-Known Member MEMBER

    Country:
    United States
    Joined:
    May 7, 2011
    Messages:
    3,486
    Likes Received:
    1,965
    Gender:
    Male
    Ratings:
    +1,989
    This is different. Can one call the properties and methods of a *nix file ?
     
  7. Gorilla

    Gorilla Well-Known Member MEMBER

    Country:
    United States
    Joined:
    Jan 31, 2009
    Messages:
    2,479
    Likes Received:
    1,382
    Gender:
    Male
    Ratings:
    +1,399
    Yep. Though the actual way you do it depends on how you're doing it (what programming/scripting language/utility, the syntax, and how "easy" it is). More information is available about this in books like APUE or the POSIX standard.

    I'm not knocking Microsoft for taking the design, just the opposite. I think it's impressive how they've addressed one of the classic biggest complaints about their platform and delivered a great tool. No doubt, they probably made improvements to make it more consistent with the languages and use cases they expect people to be coming from.
     
  8. thePreacher

    thePreacher Banned MEMBER

    Joined:
    Dec 2, 2007
    Messages:
    1,227
    Likes Received:
    815
    Occupation:
    Agent Of Change
    Location:
    Dogville, USA
    Ratings:
    +815
    Object oriented programming has been around for decades in the non-Windows world. I have been coding with it for at least a decade and a half despite the fact that I have never written a line of code using Powershell and probably never will as long as it is MS Windows specific.

    I admit to being one of those anti-MS people. My Mac is down for repairs this week so I bought a cheap Dell running XP for $95 to get by until I can use my 'real' computer again. This has reminded me of all the reasons I stopped buying Windows computers back in 2006. MS, Windows specifically, has historically always played catch up with what better OSes were already doing. MS-DOS played catch up with Dr Dos. I can remember back when Windows did not even include network support. The Media Player for XP did not support playing DVDs without needing to have an additional decoder installed.

    Despite Windows' long history of vunerability to malware, it was not until Windows 7 that MS offered a no extra cost virus scanner [MSE]. To their credit, I did recently find out that MS does now offer MSE as a free download for XP users [which to my perception works better than Mcafee]. But, note, I have been using Macs since 2006 and have never yet had even one malware attack. But, should a Mac user want a virus scanner anyway there is ClamXav which is open source.

    Windows historically used the flawed MBR [Master Boot Record] way of partitioning drives and did not follow the lead of MAC and Unix/Linux in supporting the newer, better, GPT [GUID Partiton Table] Way of partitioning disks until Vista [which is why drives I formatted on my 2007 Macbook are not recognized by my Dell running XP even though drives I formatted on my Dell are recognized by my Macbook].

    One of the reasons I have settled on Python as my language of choice is that it can reasonably be called a scripting language, even though it is much more than that, and has been OOP since day one back in the 80s. I use Eclipse to code Python with MAC OSX and Linux. But, predictably, there is something about XP which prevents PyDev from loading so I use PyCharm to code Python on my Dell.
     
  9. Shikamaru

    Shikamaru Well-Known Member MEMBER

    Country:
    United States
    Joined:
    May 7, 2011
    Messages:
    3,486
    Likes Received:
    1,965
    Gender:
    Male
    Ratings:
    +1,989
    Object oriented scripting is a cat of a different stripe ....

    Being able to mix scripting with programming is something different all together ... almost like a hybrid language, IMO.
     
  10. thePreacher

    thePreacher Banned MEMBER

    Joined:
    Dec 2, 2007
    Messages:
    1,227
    Likes Received:
    815
    Occupation:
    Agent Of Change
    Location:
    Dogville, USA
    Ratings:
    +815
    Scripting is programming. I do not get why you are drawing a distinction other than that, perhaps, Powershell is not pure OOP and your position is that scripting languages need not be OOP.

    Whether we think of a language as OOP or not, regardless of if it is being marketed as for scripting, programming, or both, can be best ascertained by the answer to one simple question.

    Does it allow anything to be anything other than an object?

    OOP is the best approach to programming, even when you call programming scripting, because OOP reflects the Way the Universe works. As above, so below. All are child classes, inheriting from the Divine One Object. Properties and methods are aspects [neters] of the One [RA]:

    John 17:21 That they all may be one; as thou, Father, art in me, and I in thee, that they also may be one in us: that the world may believe that thou hast sent me.​

    class Ra:
    def WhoAmI (self):
    Neter = "Man, Know Self"
    print (Neter)

    class Man (Ra):
    pass

    Istlota = Man()
    Istlota.WhoAmI()
     
Loading...