<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yomon8</author_name>
  <author_url>https://blog.hatena.ne.jp/yomon8/</author_url>
  <blog_title>YOMON8.NET</blog_title>
  <blog_url>https://yomon.hatenablog.com/</blog_url>
  <categories>
    <anon>PowerShell</anon>
  </categories>
  <description>題名の通りなのですが、どのような場面で利用するかというのと一緒に書きます。Invoke-CommandでリモートセッションにScriptBlock型の変数をArgumentListとして渡そうとすると、途中でObjectに変換されてしまいます。 事象 まず、通常通りScriptBlockの変数を設定します。ここまでは問題ありません。 #script変数にScriptBlockを設定 PS &gt; $script = {param($p) Write-Host &quot;Param: $p&quot;} #script変数の型はScriptBlock PS &gt; $script.GetType() IsPublic I…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyomon.hatenablog.com%2Fentry%2F2014%2F11%2F27%2F222621&quot; title=&quot;PowerShellでStringからScriptBlockオブジェクトを生成（変換）する - YOMON8.NET&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2014-11-27 22:26:21</published>
  <title>PowerShellでStringからScriptBlockオブジェクトを生成（変換）する</title>
  <type>rich</type>
  <url>https://yomon.hatenablog.com/entry/2014/11/27/222621</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
