3
これは動作します:変数名を使用してオブジェクトからプロパティにアクセスする方法は?
$psISE.Options.DebugBackgroundColor = '#FFC86400'
これはしていません:
$attribute = 'DebugBackgroundColor'
($psISE.Options)[$attribute] = '#FFC86400'
ERROR: Unable to index into an object of type Microsoft.PowerShell.Host.ISE.ISEOptions
私は$attribute
変数を使用してforeachループにオプションの属性を設定します。
これを行う方法はありますか?
二重引用符で不要に。これはうまく動作します: '$ psISE.Options。$ attribute'。 – PetSerAl