Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
useerup
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
121.
▲
by
useerup
11y ago
> PowerShell's object pipeline is functionally analogous to function chaining in languages like Ruby, Python, and JavaScript No, in those languages function results are bound upon returning from the function. PowerShell's pipel
122.
▲
by
useerup
11y ago
That comment is utterly uninformed. If you want to run a script simultaneously on a number of hosts, you use the Invoke-Command cmdlet (or it's alias icm ). If you want to stop a process, you use Stop-Process (or it's alias
123.
▲
by
useerup
11y ago
> Out of interest, how many people here actually use async methods? Excluding being forced to by a library. We use it almost exclusively. Because of the new async/await syntax it is (almost) as easy to write and get correct as non-a
124.
▲
by
useerup
11y ago
They accept that there is less resource isolation in a plain container compared to a virtual machine container. With a plain container, any OS process that you see is the common host OS process - it is just projected into your container
125.
▲
by
useerup
11y ago
> Docker is really cool! Everyone is talking about Docker! Stupid MS. They should have known that they cannot think that anything developed outside MS is cool. We have a cult thing going here, and MS you are not invited! > We at Micro
126.
▲
by
useerup
11y ago
This neatly really illustrates why objects matter . As cool as miller is, jq is also decidedly cool, but for json. Both claim that they are "like" awk, sed, cut, paste etc, but for $Format, where $Format is csv/tsv and jso
127.
▲
by
useerup
11y ago
> hey, this was a pretty good try! But here's what else you need to do: No I don't. To open up a machine for remote administration, all I have to do is run Enable-PSRemoting like so: Enable-PSRemoting -Force For do
128.
▲
by
useerup
11y ago
Silly me, I assumed that the executable path was the requirement. My bad. If you need to find a process just by it's name, it is even simpler: Just indicate the process name (possibly with wildcards) to Get-Process (alias ps ): ps Not
129.
▲
by
useerup
11y ago
> you will uncover that PS uses the same parameter to mean very different things for different commands Example needed. The claim is surprising, given that there exists a PowerShell Command Line Standard which includes a list of parame
130.
▲
by
useerup
11y ago
Using the non-aliased verbose form of the cmdlets: $hosts = 'host1','host2','host3' $source = '\\host0\c$\source' $dest = 'c:\dest' $executable = 'C:\Program Files (x8
131.
▲
by
useerup
11y ago
> The only problem with PowerShell is that you need to write C# (or any other .NET language of course) if you want to create a real cmdlet What you say was true for PowerShell 1.0. Since 2.0 you have been able to create cmdlets and modul
132.
▲
by
useerup
11y ago
Long error messages: Yes, they can be a little strange at first. If they annoy you (or you want errors to cause a little less scrolling) you can set the "error view": $ErrorView = "CategoryView" (unlike bash, wh
133.
▲
by
useerup
11y ago
> it's basically taking bash and turning all the weirdness and bizarity up to 11 While I certainly understand where you are coming from, I have found that zsh may be more complicated, but less "weird" (i.e. it is more con
134.
▲
by
useerup
11y ago
> Is there a better shell? By which I mean more flexible, more consistent, and simpler. Yes, PowerShell. And it may actually arrive at Linux/Unix soon, due to CoreCLR. The specification is already open, but until now not much progre
135.
▲
by
useerup
11y ago
Norway uses mainly wind and hydro, Sweden mostly hydro and nuclear. When there's surplus wind energy, Sweden and Norway scales back on hydro and import from Denmark and Germany (through Denmark) instead.
136.
▲
by
useerup
11y ago
> Originally, Powershell did NOT have execution policy. Yes it did. It always had default execution policy to not allow scripts to execute. Not sure how it was set in the Monad days before PowerShell 1.0 was released, but for as long as
137.
▲
by
useerup
11y ago
A few corrections: The foremost goal when retrofitting generics into Java may have been backwards compatibility, but the requirement that drove the designers to type erasure and the clunky implementation was migration compatibility. C#
138.
▲
by
useerup
11y ago
The article touches upon something I've thought about - and the reason I don't really believe in the Apple Watch: A phone is something you pick up, work with and then put back - in the pocket, on the table or similar. A watch is s
139.
▲
by
useerup
11y ago
> What if I want to list all information about files with some mode? `ls` will still send 10^6 lines, carefully formatted, and almost all of them will be discarded with a simplest filter it could perform before reading all additional inf
140.
▲
by
useerup
11y ago
You're right. And I also screwed up "irm". It should have been "icm". Apologies.
141.
▲
by
useerup
11y ago
The same in PowerShell - using ls without the abundance of parameters - would look like: ls | sort -des LastWriteTime | select name 1: Get the "child" items of the current directory 2: sort them descending according to the
142.
▲
by
useerup
11y ago
> In PowerShell, you have to write 'programs' to get things done, in Bash (as an example), you write commands to get things done Huh? I use PowerShell (almost) daily. I do not write 'programs'. I use small steps, modi
143.
▲
by
useerup
11y ago
irm myrouter {ls c:\logs | ? length -gt 50kb} This will emit "deserialized" objects from myrouter. PowerShell remoting works across machine boundaries by defining an xml based format for serializing and deserializing obj
144.
▲
by
useerup
11y ago
PowerShell cmdlets return (active) objects in the same process space as the hosting process (usually the shell). As such they can expose expensive-to-compute properties as late-evaluated properties that are only evaluated if and when they a
145.
▲
by
useerup
11y ago
Interesting examples, especially in light of the recent debates about Unix shells and PowerShell. In PowerShell, the `ls` command is a simple command that produces output without flags to control output format, ordering or filtering. Like
146.
▲
by
useerup
11y ago
You were called upon to give some examples. Yet all you offer is more hyperbole. One is beginning to suspect that despite your assertion that you "know" Powershell better than most who use it daily, you are actually just a troll.
147.
▲
by
useerup
11y ago
Ironic that you accuse others of being condescending. You have been nothing but in this thread.
148.
▲
by
useerup
11y ago
> To be honest: no, PowerShell can't (practically) achieve the same composability PowerShell is much more composable. Just consider how all nix commands must pack insane numbers of output options. In PowerShell - just because of com
149.
▲
by
useerup
11y ago
PowerShell is supremely explorable. All you need to get started is knowledge about a few cmdlets. Get-Help, Get-Member, Get-Command and Get-Alias then you are in business. There is nothing about PowerShell that cannot be discovered throug
150.
▲
by
useerup
11y ago
Microsoft has a number of dangerous c functions that are on the Secure Development Lifecycle "banned" list. And yes, strncpy is one of them. Some insights here: https://msdn.microsoft.com/en-us/library/bb
More ›