[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Powershell
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 47
Thread images: 4
File: image0011209049392875.jpg (23 KB, 538x320) Image search: [Google]
image0011209049392875.jpg
23 KB, 538x320
Hey guys

Can I make cool shit in windows powershell like I see those guys do in linux?

I've head you can do c++ or c# in it or something, I don't really know though. I've googled it before.

Can anyone help me out?
>>
>>54504740

Powershell is a fucking mess and it's syntax gives my hands cancer
>>
>>54504802
yep
>>
>Can I make cool shit in windows powershell like I see those guys do in linux?
Not really.

>I've head you can do c++ or c# in it or something
C#.

>Powershell is a fucking mess and it's syntax gives my hands cancer
pretty much this
>>
>>54504740
just pick up ubuntu or something desu, easy to run it in virtualbox
>>
Is it possible? Sure. But trying will make you want to kill yourself and then install gentoo.
>>
>>54504740
Considering it has all .net functions available, nothing stops you from writing AAA 3D games, theoretically. Syntax is... unusual though.
>>
>>54504740
>I've head you can do c++ or c# in it or something
any .net language

c++/c# is odd because it doesn't really lend itself to REPL, and the bridging syntax is a mess. F# does though
>>
>>54505161
C# has repl now.
>>
>>54504740
try typing this and hitting enter, it gives you a great dev. environment for entering your code:
notepad

So glad I could help!
>>
Powershell is a trainwreck to work in, but is easily just as if not more powerful than bash scripting.

You can hook into any available Win32 or .NET API on the machine, so you can do some really whacky stuff. I used it and wrote a lot of REALLY useful scripts at my last job that I don't think would've been possible otherwise, but fucking damn was it a pain to write.
>>
Powershell is not shit.
Powershell is not bash, and is not trying to be bash.
Instead, Powershell is a tool for system administrators and database management admins. It has incredibly powerful integration with many windows server utilities and databases.

I would not advise using powershell as a general purpose shell. Some people do, and it works, but it was never designed with general end users in mind, because 'you should be doing it with the GUI' has always been the point of Windows.
>>
>>54505306
> gui

No, not really. Core has been a thing for almost 6 years now...
>>
>>54504740
What do you want to do?

It's easy to manipulate data (xml), call Windows dialog boxes, and even add a gui (XAML).

I have a set of scripts that I wrote that spin up hyper-v, build vms, and the build the ad domain, SQL servers, and iis stuff, all automated using powershell.

Think of its syntax less like bash and more like SQL (get, set, new, load, etc)
>>
>>54505342
>"general end users"
>Core
I think you missed my point.
>>
>>54505396
Yeah, missed the general end users part. My bad, been a long day.
>>
>>54505342

Microsoft is too fragmented to care. They say they're pushing to Server Core but Exchange 2016 still doesn't fucking support it. The shit applications that get installed on Windows servers don't support Core because MS isn't forcing software developers to write Core-supported programs, and now I'm willing to bet they're going to drop support for Core entirely in the next few years now that Nano is a thing, so now any progress on the developers side is going to need to be started all over again, and it'll still be another 10 years until Nano is being fully utilized across major environments and most software supports it.
>>
>>54505414
E16 will take a scripted install on core. But it's not officially supported.

Some of the e16 clusters in O365 are core.
>>
>>54504740
Google powershell in a month of lunches. Powershell is actually much more powerful than bash and zsh, it's great once you get the syntax and aliases. The script editor it comes with is good too.
>>
>>54505413
I can understand that. I got home at 3:30 on a thursday and went straight into a glass of OJ+Vodka.
>>
>>54504802
It even has a ton of aliases by default m8, don't be lazy.
>>
>>54505459

If it's not officially supported, it should never be done. This is MS's cluster fuck software, and when it breaks, you don't give them the option of saying, "good day this is pajeet we cannot investigate this case because do not support Server Core installations have I provided good customer service?"

Exchange isn't 7zip. If it goes down in a major way, the business is impacted severely and we're calling in Microsoft immediately while the email team investigates it on their own. If email ops can get it fixed quick, great, but if not, I need an external head on the chopping block so when the inevitable post-crisis meeting occurs, our asses are covered. If we go into the meeting and say that shit went down because we knowingly set it up in an unsupported configuration, our asses are not covered. And 95% of IT is knowing how to cover your ass.
>>
>>54505562
Except that O365 Tier 3 will still take cases when E16 goes hard down on core.

If your not getting that level of support, than I suggest you talk to your TAM, because there's a lot of shit we fix regardless of whether or not it's officially supported...

Except the E14 EAC for O365. Fuck that shit...
>>
>>54505464

It is not. There are some simple tasks like getting your NIC's IP address that should be relatively simple one liner and with several programs piped together in sh shells and for some reason in Powershell, you have to write 20+ lines to accomplish the same thing.

My main problem with it is how you can not pipe programs together like "Get-Files | robocopy | Do-Stuff-To-Files". Instead, you have to scrape text together and that's not one of Powershell's strong points since it's object pipelining is supposed to get rid of it. But the same object pipeline also prevents you from doing the above so...

In any case, using MSYS2 is as close as a sh shell on Windows that can interact with the Win32 environment as you can get. Bash on Windows doesn't count until it can let you interact with the Win32 subsystem.
>>
>>54505679
>Bash on Windows doesn't count until it can let you interact with the Win32 subsystem.

actually you can send arbitrary powershell and even CMD.exe commands from winbash, by writing text and executing it (also works in reverse)

so, given that powershell or cmd.exe can access the system resources you're using, so can winbash

hacky, yes, but it exists
>>
>>54505679
Get-NetIPAddress -InterfaceAlias (or -InterfaceIndex)
>>
>>54505709
>actually you can send arbitrary powershell and even CMD.exe commands from winbash, by writing text and executing it

How's that? Show me some evidence.
>>
>>54505729
Probably won't count, for some reason besides "hurr /g/ said it was bad!"
>>
>>54505781
>write file with winbash named "anything.bat" or "anything.ps"
>fill file with syntactically correct cmd or ps
>execute resulting file

same as any other combination of shells or command interpreters.
>>
>>54505679
So script, not scrape...

Powershell does text and xml manipulation just fine.

From your ipc example (get-item |robocopy | do stuff) it's pretty clear you don't know how to use powershell. And that's fine, but please learn more before you try to speak to a subject.
>>
PDCurses, OP
>>
>>54504740
I believe you're looking for QBasic.

Or QuickBasic 4.5 or 7.1 PDS.
>>
>>54505729

Looks like a cmdlet that got introduced in 4.0, which I am not familiar with since I only needed to work with Powershell 3.0 when I needed to do it for my job.

>>54505824

I was illustrating the fact that you couldn't do something with a Unix paradigm that should be simple to do. Instead, you have to write some function to return all the items you want to have and use robocopy with, and then write another function to do stuff with the items because of the object pipeline paradigm that Powershell endorses as "the one true way" to process data.

You can't decompose everything into objects since it's not a fundamental structure in the digital world. Often, you have to manually construct them. Bytes are the most fundamental unit in the digital world. The Unix way of treating everything as a file and piping as a matter of sending any sort of bytes to another program just makes it magnitudes more useful and simpler. There is a reason why the *nix has stuck around for so long and one of the reasons is the way it handles data.
>>
>>54504740
CopyFile-Into-Directory-Right-Now-Telemetry-TM
>>
Yeah it's pretty easy to do that.

Just open up Powershell, then close Powershell and burn it with fire, then erase your hard drive, install Ubuntu, open a terminal, write C++, and voila.
>>
>>54506300
>install Ubuntu
Great meme post.
>>
>>54505729
DELETE THIS
>>
I am not a sys admin but i work with windows admins on a daily basis. And since i have a deep hate for them and generally think they all unqualified, I will often use powershell to mark my superiority as a real developer.

The cryptic syntax gives them autism, their small brains cant compute on this level. And the look on their stupid faces, when i solve a task with just one line of code, where they would instead click endlessly through windows dialogs or use 3rd party programms for is the biggest benefit of powershell for me.

I hate the overkill of powershell tho, i rarely use it outside of showing off.
>>
>>54505796

Prove it.

If "winbash" can execute a .ps or .bat file, then I don't see why it couldn't execute a .exe. It can't execute a Win32 .exe, as has been clearly stated by several devs and Microsoft bloggers.
>>
File: 1437420543509.png (1 MB, 1366x768) Image search: [Google]
1437420543509.png
1 MB, 1366x768
>>54504740
I’d just like to interject for a moment. What you’re refering to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU project.

There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux.
>>
>>54506924
No, Richard, it's 'Linux', not 'GNU/Linux'. The most important contributions that the FSF made to Linux were the creation of the GPL and the GCC compiler. Those are fine and inspired products. GCC is a monumental achievement and has earned you, RMS, and the Free Software Foundation countless kudos and much appreciation.

Following are some reasons for you to mull over, including some already answered in your FAQ.

One guy, Linus Torvalds, used GCC to make his operating system (yes, Linux is an OS -- more on this later). He named it 'Linux' with a little help from his friends. Why doesn't he call it GNU/Linux? Because he wrote it, with more help from his friends, not you. You named your stuff, I named my stuff -- including the software I wrote using GCC -- and Linus named his stuff. The proper name is Linux because Linus Torvalds says so. Linus has spoken. Accept his authority. To do otherwise is to become a nag. You don't want to be known as a nag, do you?

(An operating system) != (a distribution). Linux is an operating system. By my definition, an operating system is that software which provides and limits access to hardware resources on a computer. That definition applies whereever you see Linux in use. However, Linux is usually distributed with a collection of utilities and applications to make it easily configurable as a desktop system, a server, a development box, or a graphics workstation, or whatever the user needs. In such a configuration, we have a Linux (based) distribution. Therein lies your strongest argument for the unwieldy title 'GNU/Linux' (when said bundled software is largely from the FSF). Go bug the distribution makers on that one. Take your beef to Red Hat, Mandrake, and Slackware. At least there you have an argument. Linux alone is an operating system that can be used in various applications without any GNU software whatsoever. Embedded applications come to mind as an obvious example.

Thanks for listening.
>>
>>54506879
Kekekek you sound like the main character in a comedy about an insecure autist in the workplace
>>
File: 1435022361372.jpg (803 KB, 600x819) Image search: [Google]
1435022361372.jpg
803 KB, 600x819
>>54506989
>>
>>54506184
The command was introduced in v3. You may have been using v2.

Your jumping in and out of powershell. Copy-item works just fine. Again, just because you don't know what you're doing doesn't mean it can't be done.
>>
>>54506383
Why, because you're stupid?
>>
>>54507642

The point I was trying to get across is that the object pipelining paradigm Powershell espouses is basically inferior in the amount of hoops you need to clear and the verbosity needed to accomplish the same task you can accomplish on an sh shell.

Besides that, there would have been no need and demand for Microsoft to feature bash that heavily when they showed off Windows Subsystem for Linux if Powershell was really that good.

Maybe it will get better and better, but there is no way personally I would say that, with the same amount of familiarity, that using Powershell would allow me to get more stuff done in less time than a sh shell would.
>>
File: andy tenners.jpg (49 KB, 500x500) Image search: [Google]
andy tenners.jpg
49 KB, 500x500
>>54506989
Listen here Linus, you finnish cunt sack of shit
you think just because you added a few lines of arse-shit code to my beautiful Minix kernel, that you've been somehow vested in the righteous authority to rename the thing after yourself?
Fucken listen here, between my ORIGINAL hard work in ripping off the Unix kernel, and Stallmans work in ripping off the utilities n shit, your contributions add up to jack fucking shit. Be glad that the world calls it LINux, because thats honestly more credit than you deserve,
>>54506924
and you, Stallman, you old semen smelling motherfucking tinhat paranoid shitstain. It's called 'open sauce' not 'free',, if you wanna make genuine changes to how people think about shit, instead of shittin on how everyone currently labels shit, adapt to it. who the fuck cares that you started this all like 30 years ago, that was 30 fucking years ago and the tech scene has drastically changed since then. If you want people to start taking you seriously you gotta adapt!

Every fucking shitskinned good and basement dwelling blight on society on this board are so fucking stupid i cant handle any of you dumbshit niggers.

im out, peace
Thread replies: 47
Thread images: 4

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.