Run PowerShell Script Parameters

Source: Internet
Author: User

Run powershell Script Parameters
File Name: A. PSL

1 Param
2 (
3 $ number
4)
5 $ sqlconnection = new-Object System. Data. sqlclient. sqlconnection
6 $ sqlconnection. connectionstring = "Server = 192.168.0.1; database = A; user = aaa; Pwd = BBB"
7 $ sqlcmd = new-Object System. Data. sqlclient. sqlcommand
8 $ sqlcmd. Connection = $ sqlconnection
9 $ sqlcmd. commandtext = "select * From pay_detail where (fynumber = $ number )"
10 $ sqladapter = new-Object System. Data. sqlclient. sqldataadapter
11 $ sqladapter. selectcommand = $ sqlcmd
12 $ dataset = new-Object System. Data. Dataset
13 $ sqladapter. Fill ($ dataset)
14 $ sqlconnection. Close ()
15 $ dataset. Tables [0]

Start powershell to run:

1. \ A 4217

Note: there is another point above.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.