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> <font color=mediumslateblue size="2">start a program / command / batch script</font> (opens in a new window)</td>
</tr>
<tr>
<td> `start .` </td>
<td> open current directory in Explorer </td>
</tr>
</table>
<br>
<table>
<tr><td colspan=2><font color=darkcyan>Powershell</font></td></tr><tr></tr>
<tr>
<td> <code>get-childitem *.mp3 | foreach { rename-item $\_ $\_.name.replace("old part", "new part") }</code>  </td>
<td> rename all `mp3` files, changing `old part` to `new part`  </td>
</tr><tr></tr>
<tr>
<td> `$i = 1` <br>
<code>get-childitem * | %{ rename-item $\_ -newname ('{0:D1}.jpg' -f $i++) }</code>  </td>
<td> rename all files as sequential numbers, starting from `1.jpg`;
<br> using `{0:D2}` instead of `{0:D1}` adds leading zero to single numbers: `01.jpg`  </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