You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-21Lines changed: 32 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,38 @@ Run C# scripts from the .NET CLI.
13
13
14
14
### Prerequisites
15
15
16
-
The only thing we need to install is [.Net Core](https://www.microsoft.com/net/download/core)
16
+
The only thing we need to install is [.Net Core SDK](https://www.microsoft.com/net/download/core).
17
+
18
+
### .Net Core 2.1 Global Tool
19
+
20
+
.Net Core 2.1 introduces the concept of global tools meaning that you can install `dotnet-script` using nothing but the .NET CLI.
21
+
22
+
```shell
23
+
dotnet tool install -g dotnet-script
24
+
25
+
You can invoke the tool using the following command: dotnet-script
26
+
Tool 'dotnet-script' (version '0.20.0') was successfully installed.
27
+
```
28
+
29
+
The advantage of this approach is that you can use the same command for installation across all platforms.
30
+
31
+
> In order to use the global tool you need [.Net Core SDK 2.1.300 preview2](https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-preview2) or higher. It also works with [.Net Core SDK 2.1.300 preview1](https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-preview1), but that one had a different syntax: `dotnet install tool -g dotnet-script` and is now deprecated.
32
+
33
+
.NET Core SDK also supports viewing a list of installed tools and their uninstallation.
34
+
35
+
```shell
36
+
dotnet tool list -g
37
+
38
+
Package Id Version Commands
39
+
---------------------------------------------
40
+
dotnet-script 0.20.0 dotnet-script
41
+
```
42
+
43
+
```shell
44
+
dotnet tool uninstall dotnet-script -g
45
+
46
+
Tool 'dotnet-script' (version '0.20.0') was successfully uninstalled.
47
+
```
17
48
18
49
### Windows
19
50
@@ -52,26 +83,12 @@ And run:
52
83
53
84
```
54
85
docker run -it dotnet-script --version
55
-
56
86
```
57
87
58
88
### Github
59
89
60
90
You can manually download all the releases in `zip` format from the [Github releases page](https://github.com/filipw/dotnet-script/releases).
61
91
62
-
### .Net Core Global Tool
63
-
64
-
.Net Core 2.1 introduces the concept of global tools meaning that we can install `dotnet-script` using nothing but the `dotnet CLI`
65
-
66
-
```shell
67
-
dotnet install tool -g dotnet-script
68
-
```
69
-
70
-
The advantage of this approach is that we will execute the same command for installation across all platforms.
71
-
72
-
> In order to use the global tool we need at least [.Net Core SDK 2.1.300 preview1](https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-preview1)
73
-
74
-
75
92
76
93
## Usage
77
94
@@ -94,8 +111,6 @@ That is all it takes and we can execute the script
94
111
dotnet script helloworld.csx
95
112
```
96
113
97
-
98
-
99
114
### Scaffolding
100
115
101
116
Simply create a folder somewhere on your system and issue the following command.
@@ -404,10 +419,6 @@ We can specify this when executing the script.
0 commit comments