初学PowerShell之太祖长拳
第一势 太祖立势真高强
PowerShell中的shell意思是“外壳”,它是相对于操作系统的“内核”(kernel)而言的。
我们平时使用的Windows中资源管理器就是一种外壳,当我们要复制一个文件时,我们在资源管理器中所做的简单拖放动作(或菜单选择)会转化为内核的一连串特定指令:
外壳 - 资源管理器:拖放复制文件
->
内核 - 底层操作系统:操纵硬件(读磁盘将文件载入内存,写磁盘复制它,并修改相应的文件分配表等等)
外壳并不是操作系统本身,而是一个用户接口,所以同一个操作系统可以有不同的外壳。在Windows XP上,管理文件系统常见的有:
1.资源管理器(Windows自带,每天都在用的:)
2.命令提示符(Windows自带的命令行工具Cmd.exe)
3.Total Commander(拖放更方便的双窗口结构)
4.PowerShell(下一代Windows命令行)
建议尽量使用图形界面工具。平时的大部分任务,都是一些极简单的任务,用Total Commander等工具已经能完成的很好了。
大多数情况下,使用图形界面比较轻松愉快。
要使用命令行需要记忆命令和其用法,增加了用户的负担,但命令行有两个优势:
1.能方便的重复执行某一操作,比如要将某文件复制100次,用鼠标复制比较费力。
2.能让某些复杂的任务自动化,比如每周从百度自动下载“新歌TOP100”中的前10首歌,如果在浏览器中用鼠标点击下载则比较费时。
第一势的心法:判断是否使用命令行工具PowerShell。
Last edited by tigerpower on 2006-5-14 at 12:04 ]
The First Move in Learning PowerShell: The Foundational Moves
First Move: The Strong Posture of the Founding Emperor
In PowerShell, "shell" means "shell," which is relative to the "kernel" of the operating system.
The File Explorer we usually use in Windows is a kind of shell. When we want to copy a file, the simple drag-and-drop action (or menu selection) we do in File Explorer will be transformed into a series of specific instructions of the kernel:
Shell - File Explorer: Drag-and-drop to copy a file
->
Kernel - Underlying operating system: Manipulate hardware (read the disk to load the file into memory, write the disk to copy it, and modify the corresponding file allocation table, etc.)
The shell is not the operating system itself, but a user interface. So the same operating system can have different shells. On Windows XP, common ones for managing the file system are:
1. File Explorer (built-in with Windows, used every day:)
2. Command Prompt (built-in command-line tool Cmd.exe for Windows)
3. Total Commander (double-window structure for more convenient drag-and-drop)
4. PowerShell (next-generation Windows command line)
It is recommended to use graphical interface tools as much as possible. Most of the usual tasks are extremely simple tasks, which can be well completed with tools like Total Commander.
Most of the time, using the graphical interface is relatively easy and enjoyable.
Using the command line requires memorizing commands and their usages, which increases the user's burden, but the command line has two advantages:
1. Can easily repeat a certain operation. For example, if you need to copy a certain file 100 times, using the mouse to copy is relatively laborious.
2. Can automate some complex tasks. For example, automatically download the top 10 songs from "New Songs TOP100" from Baidu every week. If you click to download with the mouse in the browser, it is relatively time-consuming.
The mental note for the first move: Judge whether to use the command-line tool PowerShell.
Last edited by tigerpower on 2006-5-14 at 12:04 ]