markdown powershell + cmd

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown powershell + cmd相关的知识,希望对你有一定的参考价值。


<font size=1><font color=lightblue>* examples in this color</font> <font color=lightgray><i>or italized lightgray</i></font> <font color=silver>or maybe in silver</font>
<font color=gray size=2>
<table>
  <tr><td colspan=2><font color=darkcyan>CMD</font></td></tr>
  <tr>
    <td><font color=mediumslateblue>`start`</font></td>
    <td>&nbsp; <font color=mediumslateblue size="2">start a program / command / batch script</font> (opens in a new window)</td>
  </tr>
  <tr>
    <td>&nbsp; `start .` &nbsp;</td>
    <td>&nbsp; open current directory in Explorer &nbsp;</td>
  </tr>
</table>
<br>

<table>
  <tr><td colspan=2><font color=darkcyan>Powershell</font></td></tr><tr></tr>
  <tr>
    <td>&nbsp; <code>get-childitem &ast;.mp3 | foreach { rename-item $\_ $\_.name.replace("old part", "new part") }</code> &emsp;</td>
    <td>&nbsp; rename all `mp3` files, changing `old part` to `new part` &emsp;</td>
  </tr><tr></tr>
  <tr>
    <td>&nbsp; `$i = 1` <br>
    &nbsp; <code>get-childitem &ast; | %{ rename-item $\_ -newname ('{0:D1}.jpg' -f $i++) }</code> &emsp;</td>
    <td>&nbsp; rename all files as sequential numbers, starting from `1.jpg`; 
    <br>&nbsp; using `{0:D2}` instead of `{0:D1}` adds leading zero to single numbers: `01.jpg` &emsp;</td>
  </tr>
</table>
<br>
</font>

以上是关于markdown powershell + cmd的主要内容,如果未能解决你的问题,请参考以下文章

markdown PowerShell #powershell中的Powershell最佳实践(对我而言)

CMD和win powershell有啥区别

powershell和cmd区别

powershell 从PowerShell运行CMD中的命令

markdown Powershell基础知识

markdown Windows Powershell