Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you can write the path to a temporary txt file, the following works OK:</p> <pre><code>(get-item -literalpath (gc 'C:\Temp\path.txt')).creationTime </code></pre> <p>The file @ C:\Temp\path.txt contains the path with special characters in it, other than this I think you would have to escape each special character on a per path basis.</p> <p>In addition to the hack above, it appears Powershell V3 may help out here with the addition of a new 'magic parameter' language feature. Specifically, see the section headed 'Easier Reuse of Command Lines From Cmd.exe' <a href="http://blogs.msdn.com/b/powershell/archive/2012/06/14/new-v3-language-features.aspx">here</a> and because I hate link-rot, here it is, shamelessly reproduced below:</p> <blockquote> <p><strong>Easier Reuse of Command Lines From Cmd.exe</strong></p> <p>The web is full of command lines written for Cmd.exe. These commands lines work often enough in PowerShell, but when they include certain characters, e.g. a semicolon (;) a dollar sign ($), or curly braces, you have to make some changes, probably adding some quotes. This seemed to be the source of many minor headaches.</p> <p>To help address this scenario, we added a new way to “escape” the parsing of command lines. If you use a magic parameter --%, we stop our normal parsing of your command line and switch to something much simpler. We don’t match quotes. We don’t stop at semicolon. We don’t expand PowerShell variables. We do expand environment variables if you use Cmd.exe syntax (e.g. %TEMP%). Other than that, the arguments up to the end of the line (or pipe, if you are piping) are passed as is. Here is an example:</p> <pre><code>echoargs.exe --% %USERNAME%,this=$something{weird} Arg 0 is &lt;jason,this=$something{weird}&gt; </code></pre> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload