前スレ
PowerShell -Part 3
https://mevius.5ch.net/test/read.cgi/tech/1539074808/
次スレは>>980が立ててね!!
PowerShell -Part 4
レス数が1000を超えています。これ以上書き込みはできません。
2020/01/01(水) 16:08:31.66ID:4oQ1Kxot
982デフォルトの名無しさん
2021/03/13(土) 15:36:01.07ID:ErfpRTBJ (gsv adobe*).status -contains 'running'
983デフォルトの名無しさん
2021/03/13(土) 15:48:12.79ID:Qa5+c/Kf >>979
[int][bool](Get-Service | Where-Object {($_.Name -Match 'Adobe') -and ($_.Status -Match 'Running')})
[int][bool](Get-Service | Where-Object {($_.Name -Match 'Adobe') -and ($_.Status -Match 'Running')})
984デフォルトの名無しさん
2021/03/13(土) 20:59:36.95ID:3roljCwu985デフォルトの名無しさん
2021/03/14(日) 15:40:02.21ID:am3+IzSP PowerShellは処理の方法が多くていいな
986デフォルトの名無しさん
2021/03/14(日) 21:46:47.24ID:8YYOAayf 連想配列の参照渡しで
function f([ref]$h) { $h.value }
$h = @{ a = 0; b = 1}
f([ref]$h)
はうまくいくんだけど、引数もう一個増やして
function f([ref]$h, $s) { $h.value; $s }
$h = @{ a = 0; b = 1}
$s = 2
f([ref]$h, $s)
にすると、
f : パラメーター 'h' の引数変換を処理できません。引数には参照型を指定する必要があります。
何が悪いん?ググっても見つけられなくてさっきから悩んでる(汗
function f([ref]$h) { $h.value }
$h = @{ a = 0; b = 1}
f([ref]$h)
はうまくいくんだけど、引数もう一個増やして
function f([ref]$h, $s) { $h.value; $s }
$h = @{ a = 0; b = 1}
$s = 2
f([ref]$h, $s)
にすると、
f : パラメーター 'h' の引数変換を処理できません。引数には参照型を指定する必要があります。
何が悪いん?ググっても見つけられなくてさっきから悩んでる(汗
987デフォルトの名無しさん
2021/03/14(日) 21:55:49.94ID:8nGQn8Lf 括弧とカンマいらないのでは
988デフォルトの名無しさん
2021/03/14(日) 22:41:43.33ID:T+RcbFBu f ([ref]$h) $s
989デフォルトの名無しさん
2021/03/14(日) 23:07:21.02ID:8YYOAayf990デフォルトの名無しさん
2021/03/15(月) 15:30:15.42ID:2OtrSpOH カッコとカンマで引数渡すのはオブジェクトのメソッドの時だけだね
関数はスペース区切りで渡す
これは文法だから理由はない
関数はスペース区切りで渡す
これは文法だから理由はない
991デフォルトの名無しさん
2021/03/15(月) 16:45:16.26ID:bRJV5TtK 1, 2 で配列作っちゃうようにしちゃったからねぇ
記法がシェルスクリプトとプログラム言語のあいの子みたいになってるからちょっと直感に反する所がちらほら見え隠れするのはしょうがない
記法がシェルスクリプトとプログラム言語のあいの子みたいになってるからちょっと直感に反する所がちらほら見え隠れするのはしょうがない
992デフォルトの名無しさん
2021/03/16(火) 23:02:58.87ID:Bd62bkLQ993デフォルトの名無しさん
2021/03/17(水) 08:00:24.75ID:EzeD0xtp 俺がPowerShellを気に入ったのはPerlと同じ匂いを感じたからだ
994デフォルトの名無しさん
2021/03/17(水) 08:19:50.03ID:vnLGIRIV しかしPerlではないのがいいところ
995デフォルトの名無しさん
2021/03/17(水) 08:38:00.89ID:sqd1XF3h Why did you do that? $VAR/ {} / Weak Intellisense
https://docs.microsoft.com/en-us/archive/blogs/monad/why-did-you-do-that-var-weak-intellisense
The $ in front of variables comes from our design center of being an interactive command oriented shell.
Interactive shells are NOT the same thing as Scripting languages with command interpretors.
Interactive shells are case studies in engineering tradeoffs (another way of saying that is that they tend to be a little quirky).
There is a tension between the needs of a great interactive experience and a great scripting/programming experience.
Time and time again during the course of the project, people would try to make us "choose" between one or the other.
We refused.
We believe that if you work hard enough at it, you can solve the puzzle and provide a great solution for both.
We were absolutely subborn on this point. Time and time again, we were able to succeed with this approach if we travailed long enough.
https://docs.microsoft.com/en-us/archive/blogs/monad/why-did-you-do-that-var-weak-intellisense
The $ in front of variables comes from our design center of being an interactive command oriented shell.
Interactive shells are NOT the same thing as Scripting languages with command interpretors.
Interactive shells are case studies in engineering tradeoffs (another way of saying that is that they tend to be a little quirky).
There is a tension between the needs of a great interactive experience and a great scripting/programming experience.
Time and time again during the course of the project, people would try to make us "choose" between one or the other.
We refused.
We believe that if you work hard enough at it, you can solve the puzzle and provide a great solution for both.
We were absolutely subborn on this point. Time and time again, we were able to succeed with this approach if we travailed long enough.
996デフォルトの名無しさん
2021/03/17(水) 11:52:58.50ID:eAjGywmP interactive性は'標準で'エイリアスが定義されてることで十分満足してる
997デフォルトの名無しさん
2021/03/18(木) 00:08:54.40ID:t06qOp3P PerlとPythonは文字に対するencode, decodeの意味が逆。まめな
998デフォルトの名無しさん
2021/03/18(木) 00:30:47.74ID:/MpReTiX999デフォルトの名無しさん
2021/03/18(木) 00:39:40.12ID:3weRgygV >>998
ナイス滑り込み
ナイス滑り込み
1000デフォルトの名無しさん
2021/03/18(木) 01:34:48.09ID:dIgskCmL 質問良いですか
10011001
Over 1000Thread このスレッドは1000を超えました。
新しいスレッドを立ててください。
life time: 441日 9時間 26分 17秒
新しいスレッドを立ててください。
life time: 441日 9時間 26分 17秒
レス数が1000を超えています。これ以上書き込みはできません。
ニュース
- 【和訳付き】レーダー照射問題 中国軍と自衛隊との“音声データ”公開 中国国営メディア [♪♪♪★]
- 【YouTuber】バイク事故で入院のゆたぼん、振込で「お見舞金」募る [muffin★]
- 「中国側も日本機のレーダーを感知していた」 中国メディアが報道 [♪♪♪★]
- 中国とロシアの爆撃機、日本周辺で共同飛行 [少考さん★]
- 堀江貴文、キャッシュレス非対応の店にモヤッ 『PayPay』立ち上げの人物にまさかの直談判「現金決済しかできないんだけど…」 [冬月記者★]
- 高市早苗首相、消費税減税に後ろ向き 足かせはレジシステム? 「責任ある積極財政」期待高いが [蚤の市★]
- 【悲惨】中国軍が自衛隊に「事前通告」し自衛隊も返答した音声が公開されてしまうwwwこれは高市チェックアウトゕ★2 [597533159]
- 【悲惨】中国軍が自衛隊に「事前通告」し自衛隊も返答した音声が公開されてしまうwwwこれは高市チェックアウトゕ★3 [597533159]
- 【高市筋肉】筋トレおじさん、爆増wwwwwwwwwwwwwステロイド使用も増 [308389511]
- 【悲報】JA「全然米が売れなくて倉庫を圧迫してる。助けて!」米卸売り業者「安売りしたら赤字になる…助けて!」 [802034645]
- 俺が突拍子もないレスするとスクリプト扱いされるの不満なんだが
- 中国の日本向けレアアースの輸出止まる、高市のせいで日本終了のお知らせ [931948549]
