ちゃっぴの監禁部屋

ガチガチに締めすぎて動きがとれなくなる。。。

ホーム 連絡をする 同期する ( RSS 2.0 ) Login
投稿数  405  : 記事  5  : コメント  12114  : トラックバック  134

ニュース

記事カテゴリ

書庫

日記カテゴリ

Communities

Personal Information

めちゃくちゃ気持ち悪いんですけど。

function WriteEventEntry(
	  [System.String] $strMessage
	, [System.Diagnostics.EventLogEntryType] $logType = 'Error')
{
	Set-Variable -Name 'strSource' -Value 'Test' -Option 'Constant';
	Set-Variable -Name 'strLogName' -Value 'Application' -Option 'Constant';
	
	$eventlog = New-Object `
		-TypeName 'System.Diagnostics.EventLog' `
		-ArgumentList $strLogName;
	$eventlog.Source = $strSource;
	$eventlog.WriteEntry($strMessage, $logType);
}

こんな関数書いたんですが、なんで下記のようによびださなければならないの?

WriteEventEntry 'Message' 'Information'

こうゆう呼び出しできるようにしてほしいんですけど

WriteEventEntry 'Message' [System.Diagnostics.EventLogEntryType]::Information

なんで、文字列で指定するの?

投稿日時 : 2008年5月23日 2:53

コメント

# re: PowerShell での Enumeration 2008/05/23 10:30 よこけん
はじめまして、よこけんと申します。

なぜか [System.Diagnostics.EventLogEntryType]::Information が文字列として認識されるようですね。
() や $() で囲んで指定するか、予め変数に格納して変数を指定するかすれば列挙値を渡すことができます。

# re: PowerShell での Enumeration 2008/05/23 12:10 牟田口大介
式モードとコマンドモードを早く体得すると幸せになれます
説明あるけど読んでもたぶん分からない・・

# re: PowerShell での Enumeration 2008/05/23 12:36 よこけん
> 説明あるけど読んでもたぶん分からない・・
以前読んだけれどわからなかったクチです^^;
今読み返してようやくわかりました。
関数呼び出しは文字で始まって文字または空白が続くから、コマンドモードになるんですね。

# re: PowerShell での Enumeration 2008/05/25 16:01 ちゃっぴ
こういうのがあるとお手軽に見えて、実際は複雑性を高めているしか思えないんですけど。

# prednisone 20mg prices https://prednisonesnw.com/#
buy prednisone 1 mg mexico 2021/11/13 9:40 Prednisone
prednisone 20mg prices https://prednisonesnw.com/#
buy prednisone 1 mg mexico

# buy careprost in the usa free shipping https://bimatoprostrx.com
buy bimatoprost
2021/12/13 16:09 Hksfnjkh
buy careprost in the usa free shipping https://bimatoprostrx.com
buy bimatoprost


# clomid 2020 https://clomidt.com
purchase clomid 2022/01/03 19:21 Clomid
clomid 2020 https://clomidt.com
purchase clomid

# generic for doxycycline https://doxycyline1st.com/
doxycycline hydrochloride 100mg 2022/02/26 8:24 Jusidkid
generic for doxycycline https://doxycyline1st.com/
doxycycline hydrochloride 100mg

# best over the counter acne treatment 2023/01/27 5:40 Jamessop
https://over-the-counter-drug.com/# over the counter eye drops for pink eye

# over the counter oral thrush treatment 2023/01/29 10:58 Thomasneows
https://doxycycline.science/# doxycycline 100mg price

# All trends of medicament. Learn about the side effects, dosages, and interactions.
https://edonlinefast.com
Everything information about medication. drug information and news for professionals and consumers. 2023/02/18 15:20 EdOnline
All trends of medicament. Learn about the side effects, dosages, and interactions.
https://edonlinefast.com
Everything information about medication. drug information and news for professionals and consumers.

# All trends of medicament. Comprehensive side effect and adverse reaction information.
https://canadianfast.com/
Long-Term Effects. Actual trends of drug. 2023/02/19 12:53 CanadaBest
All trends of medicament. Comprehensive side effect and adverse reaction information.
https://canadianfast.com/
Long-Term Effects. Actual trends of drug.

# Get information now. Get information now.
https://canadianfast.com/
Best and news about drug. Get information now. 2023/02/20 0:24 CanadaBest
Get information now. Get information now.
https://canadianfast.com/
Best and news about drug. Get information now.

# doors2.txt;1 2023/03/14 16:56 mUHFxVUXEvMyDcDqMym
doors2.txt;1

# carprofen without vet prescription - https://cheapdr.top/# 2023/04/03 9:36 Dikolipo
carprofen without vet prescription - https://cheapdr.top/#

# buy cytotec in usa - https://cytotecsale.pro/# 2023/04/29 4:42 Cytotec
buy cytotec in usa - https://cytotecsale.pro/#

# over the counter adderall https://overthecounter.pro/# 2023/05/08 22:48 OtcJikoliuj
over the counter adderall https://overthecounter.pro/#

# over the counter laxatives 2023/05/11 0:19 TommyAmora
http://overthecounter.pro/# over the counter stocks

# buy ed pills 2023/05/15 10:39 Mickeynix
http://edpills.pro/# buy ed pills online

# prednisone in uk https://prednisonepills.pro/# - prednisone prescription online 2023/06/05 1:37 Prednisone
prednisone in uk https://prednisonepills.pro/# - prednisone prescription online

# п»їcytotec pills online 2023/06/07 1:42 Davidodota
http://prednisonepills.pro/# prednisone brand name in india

# best pills for ed 2023/06/10 13:18 BennySpuse
https://edpillsfd.com/# best ed treatment

# ed dysfunction treatment 2023/06/30 15:14 JosephKarnE
https://edpill.pro/# natural ed medications

# versandapotheke deutschland 2023/09/26 12:50 Williamreomo
http://onlineapotheke.tech/# online apotheke deutschland
online apotheke preisvergleich

# online apotheke gГјnstig 2023/09/26 23:05 Williamreomo
http://onlineapotheke.tech/# versandapotheke deutschland
online apotheke deutschland

# п»їonline apotheke 2023/09/27 0:30 Williamreomo
https://onlineapotheke.tech/# online apotheke preisvergleich
gГ?nstige online apotheke

# internet apotheke 2023/09/27 2:55 Williamreomo
http://onlineapotheke.tech/# versandapotheke versandkostenfrei
gГ?nstige online apotheke

# п»їonline apotheke 2023/09/27 7:12 Williamreomo
https://onlineapotheke.tech/# versandapotheke
п»?online apotheke

# п»їonline apotheke 2023/09/27 10:30 Williamreomo
https://onlineapotheke.tech/# online apotheke gГ?nstig
п»?online apotheke

# п»їonline apotheke 2023/09/27 11:16 Williamreomo
https://onlineapotheke.tech/# online apotheke deutschland
online apotheke deutschland

# farmacia online migliore 2023/09/27 17:42 Rickeyrof
acheter sildenafil 100mg sans ordonnance

# farmacia online piГ№ conveniente 2023/09/27 18:45 Rickeyrof
acheter sildenafil 100mg sans ordonnance

# farmaci senza ricetta elenco 2023/09/27 20:55 Rickeyrof
acheter sildenafil 100mg sans ordonnance

# safe canadian pharmacies online 2023/10/16 13:03 Dannyhealm
Offering a global touch with every service. http://mexicanpharmonline.shop/# reputable mexican pharmacies online

# canada pharmacies online prescriptions 2023/10/16 14:22 Dannyhealm
Great place with even greater staff. https://mexicanpharmonline.shop/# mexican pharmaceuticals online

# rx from canada 2023/10/16 18:16 Dannyhealm
The gold standard for international pharmaceutical services. https://mexicanpharmonline.com/# mexican border pharmacies shipping to usa

# canadian pharamacy 2023/10/16 22:51 Dannyhealm
Always responsive, regardless of time zones. http://mexicanpharmonline.com/# mexican border pharmacies shipping to usa

# canada prescription online 2023/10/17 4:11 Dannyhealm
They offer the best prices on international brands. http://mexicanpharmonline.com/# mexican mail order pharmacies

# best online canadian pharmacies 2023/10/18 3:20 Dannyhealm
Outstanding service, no matter where you're located. https://mexicanpharmonline.shop/# mexican pharmaceuticals online

# canadian pharmacies that ship to the us 2023/10/19 4:09 Dannyhealm
Efficient service with a personal touch. https://mexicanpharmonline.com/# mexico drug stores pharmacies

# buy plavix https://plavix.guru/ buy plavix 2023/10/24 0:44 Plavixxx
buy plavix https://plavix.guru/ buy plavix

# paxlovid generic https://paxlovid.bid/ paxlovid for sale 2023/10/25 22:58 Paxlovid
paxlovid generic https://paxlovid.bid/ paxlovid for sale

# ed medication online 2023/11/21 2:52 WilliamApomb
http://edpills.monster/# best ed pills online

# where can i get doxycycline https://doxycycline.forum/ buy doxycycline for dogs 2023/11/25 13:15 Doxycycline
where can i get doxycycline https://doxycycline.forum/ buy doxycycline for dogs

# canadian drug stores 2023/12/03 11:55 MichaelBum
https://paxlovid.club/# buy paxlovid online

# farmacia online senza ricetta https://farmaciait.pro/ farmaci senza ricetta elenco 2023/12/04 10:14 Farmacia
farmacia online senza ricetta https://farmaciait.pro/ farmaci senza ricetta elenco

# can i buy generic clomid now 2023/12/26 19:58 RaymondGrido
http://clomid.site/# cost generic clomid

# paxlovid price 2023/12/27 8:12 Brianmooda
http://paxlovid.win/# paxlovid price

# cheap clomid price 2024/01/12 9:08 JeffreyRom
https://paxlovid.guru/# paxlovid buy

# migliori farmacie online 2023 2024/01/17 2:11 Wendellglaks
http://farmaciaitalia.store/# farmacia online miglior prezzo

# farmacie online sicure 2024/01/17 7:59 Wendellglaks
http://avanafilitalia.online/# farmacia online migliore

# tamoxifen vs raloxifene 2024/01/21 18:03 Normantug
https://clomidpharm.shop/# order generic clomid pills

# п»їpharmacie en ligne 2024/01/28 9:34 AndresZot
https://pharmadoc.pro/# Pharmacies en ligne certifiГ©es
acheter medicament a l etranger sans ordonnance

# stromectol ebay 2024/01/29 22:01 Andrewamabs
https://prednisonetablets.shop/# generic prednisone cost

# stromectol for head lice 2024/01/31 6:06 Andrewamabs
http://prednisonetablets.shop/# prednisone 20mg tab price

# ivermectin lice 2024/02/01 6:25 Andrewamabs
http://clomiphene.icu/# cost of clomid for sale

# buy cytotec pills online cheap 2024/03/01 11:00 Irvinliz
http://cytotec24.shop/# buy cytotec online

# online single sites 2024/03/03 22:57 RodrigoGrany
https://lanarhoades.fun/# lana rhoades

# japanese dating site 2024/03/05 3:18 RodrigoGrany
http://sweetiefox.online/# sweety fox

# meet local singles free 2024/03/05 11:41 RodrigoGrany
https://evaelfie.pro/# eva elfie

# date website free 2024/03/07 12:55 HowardBox
victoriasonlinedating: https://evaelfie.site/# eva elfie new videos

# free dating sites without registering 2024/03/08 8:11 HowardBox
dating guide: http://miamalkova.life/# mia malkova only fans

# doxycycline 150 mg 2024/04/14 10:49 Archiewef
https://misoprostol.top/# cytotec online

# purchase cytotec https://cytotec.club/ cytotec online 2024/04/28 2:02 Cytotec
purchase cytotec https://cytotec.club/ cytotec online

Post Feedback

タイトル
名前
Url:
コメント