Suitable for PowerShell3.0 or higher version
Sometimes, you may occasionally find the following code:
Copy Code code as follows:
$FilePath = "$env: Systemroot\windowsupdate.log"
$ContentsWithLinebreaks = (get-content
Applies to all Windows PowerShell versions
To see who the owner of a particular process is, and how many instances of a change process, you can try the following code:
Copy Code code as follows:
$ProcessName = ' Explorer.exe '
All versions are supported.
Here's a simple code to get permission for a folder or program to assign to a different object. Note that the path must all exist:
Copy Code code as follows:
$FolderToCopyFrom = ' C:\folder1 '
$FolderToCopyTo
Use simple TCP sockets to simply determine whether a port is available:
Copy Code code as follows:
Function test-portavailable
{
Param
[Validaterange (1,65535)]
[INT] $Port
)
$sockt =new-object
I used to put a script fragment in a string, a multiline string called here-string, such as:
Copy Code code as follows:
$code =@ "
Invoke-webrequest
Get-service-name Adobearmservice
"@
Disadvantages have two:
If I am this $code string
A filter is a special form of a function.
To define a filter:
Filter (keyword) filter name (parameter) {code}
Unlike a definition function, a function uses the "$input" variable to get information from a pipe character, and the filter uses the
Logical Judgment
Let's begin by simply introducing the most basic logical judgments:
-eq judgment is equal to (equal)
-lt judgment time less than (less than)
-GT judgment is greater than (greater than)
-ge is judged to be greater than or equal to
Recently in looking at the database of books and videos, I think the database import and export is very useful, by the way to do a summary, lest there will be forgotten Ah! In fact, import and export is very similar, the idea is the same, there are
Cause there may be a few points you can exclude at 1.1
1, did not specify the user assigned to him a user (can have Administrator privileges), service
Inside find the corresponding SQL service: Computer--> Management---> Service and Application-->
1. Open SQL Server Management Studio and select SQL Server Agent in the Object Explorer list.
--2. Right-click SQL Server Agent, select Start (S), and if you have started, omit this step;
--3. Expand the SQL Server Agent list, right-click Job-->
Most of us have used sql2008, there is a small problem, every time you open, you need to use the following screen to connect the server
This picture everyone is very familiar with, hehe
Today suddenly want to be able to use the server connection
Copy Code code as follows:
--recursive subordinate by parent
With CTE (Id,parentid,text)
As
(--The parent
Select Id,parentid,text from treeview where ParentID = 450
UNION ALL
--Subordinate in recursive result set
Select T.id,t.parentid,t.
If you force a change, you receive the following prompt: You are not allowed to save changes. Your changes require that the following tables be deleted and recreated. You made changes to the label that could not be recreated or enabled the "Prevent
--Note: For example, the following data
ID Id_value
-----------------
1 ' aa,bb '
2 ' AA,BB,CC '
3 ' AAA,BBB,CCC '
--Convert to the following format
ID Id_value
-----------------
1 ' AA '
1 ' BB '
2 ' AA '
2 ' BB '
2 ' CC '
3 ' AAA '
3 ' BBB '
3 '
Recently did the project when used in the form of Tiltewindow pop-up window, found that sometimes accidentally drag the window onto the top will not be dragged back, resulting in pop-up windows can not be closed, and later found a good solution, in
Copy Code code as follows:
public class Returnresult
{
public int Curindex {get; set;}
Public DataTable idxlist {get; set;}
}
Test database connection
[WebMethod (Description = "!!! Test database connection, link string in
The first is the external item Profiler file:
Copy Code code as follows:
Xmlns:s= "Library://ns.adobe.com/flex/spark"
xmlns:mx= "Library://ns.adobe.com/flex/mx"
Autodrawbackground= "true" >
[Embed (source=
Beginning to confine the control to the label, it seems unrealistic to realize that. You should use the TEXTAREA control:
Copy Code code as follows:
xmlns:s= "Library://ns.adobe.com/flex/spark"
xmlns:mx= "library://"
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