Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Professional Windows PowerShell Programming phần 4
Đang chuẩn bị liên kết để tải về tài liệu:
Professional Windows PowerShell Programming phần 4
Trường An
70
34
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
là một phần mặc định của Windows PowerShell. Khi một snap-in được tải trong Windows PowerShell, tất cả các cmdlet và các nhà cung cấp trong snap-in có sẵn cho người dùng. Mô hình này cho phép các quản trị viên để tùy chỉnh shell bằng cách thêm | Chapter 4 Developing Cmdlets Parameter Mandatory true ValidateEvenNumber public int Number get return number set number value protected override void ProcessRecord Now try running the Get-EvenNumber cmdlet with an odd argument value for the Number parameter PS C user gxie get-evennumber -number 13 Get-EvenNumber Cannot validate argument on parameter Number . Not an even num Ber. At line 1 char 23 get-evennumber -number 13 As you can see an error is reported because even number validation failed. Parameter Transformation In cmdlet development parameters can be defined as any .NET types from simple types such as string int to complicated types such as System.Process. One common task however is to design the cmdlet so that parameter values can be easily typed in from the command line. For example assume that you want to develop a cmdlet Unite-Rectangle which calculates the union of two rectangles Using System.Drawing Cmdlet Unite Rectangle public class UniteRectangleCommand PSCmdlet Rectangle rectangle1 new Rectangle 0 0 0 0 Parameter Mandatory true Position 1 public Rectangle Rectangle1 80 Chapter 4 Developing Cmdlets get return rectanglei set rectanglei value Rectangle rectangle2 new Rectangle 0 0 0 0 Parameter Mandatory true Position 2 public Rectangle Rectangle2 get return rectangle2 set rectangle2 value protected override void ProcessRecord WriteObject Rectangle.Union rectangle1 rectangle2 You can see that both parameters Rectanglei and Rectangle2 have the type System.Drawing. Rectangle. To specify rectangle values for these command parameters you would have to create rectangle objects first using the new-object cmdlet and then pass them to the new cmdlet as shown in the following example PS C user gxie ri new-object system.drawing.rectangle 1 2 1 1 PS C user gxie r2 new-object system.drawing.rectangle 3 4 1 1 PS C user gxie Unite-Rectangle r1 r2 Location Size X Y Width Height Left X 1 Y 2 Width 3 Height 3 1 2 3 3 1 81 Chapter 4 Developing Cmdlets Top 2 Right 4 .
TÀI LIỆU LIÊN QUAN
Professional Windows PowerShell Programming: Snapins, Cmdlets, Hosts and Providers
Professional Windows PowerShell Programming
Professional Windows PowerShell Programming phần 5
Professional Windows PowerShell Programming phần 6
Professional Windows PowerShell Programming phần 7
Professional Windows PowerShell Programming phần 8
Professional Windows PowerShell Programming phần 9
Professional Windows PowerShell Programming phần 10
Professional Windows PowerShell Programming phần 1
Professional Windows PowerShell Programming phần 2
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.