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: 1-Draft/RFCXXXX-PowerShell-Core-Interop-Module.md
+23-10Lines changed: 23 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,16 @@
1
1
2
-
3
2
RFC: RFC<four digit unique incrementing number - assigned by Committee>
3
+
4
4
Author: Darwin Sanoy
5
+
5
6
Status: Draft
7
+
6
8
SupercededBy:
9
+
7
10
Version: 0.1
11
+
8
12
Area: Standard Modules
13
+
9
14
Comments Due: 5/1/2017
10
15
---
11
16
@@ -17,35 +22,43 @@ I have written serveral debugging scripts which also run, unmodified, on Linux o
17
22
18
23
I have learned serveral fixups that go a long way to making things work without changing the code. For example, creating $env:temp and pointing it to /tmp on Linux.
19
24
20
-
I know that some will think that this support should be bi-directional - but I personally feel that the adoption of PowerShell on Linux will most likely be
25
+
I personally feel that the adoption of PowerShell on Linux will most likely be
21
26
driven by those who know PowerShell well on Windows and want to use it to manage Linux. I think it will be quite a while before there is much traction to
22
27
go the other direction (start learning PowerShell on Linux, get proficient, start using it to manage Windows). It is also a little more challenging to go the other
23
-
was as Linux does not rely on as many environment variables to point to platform-wide standard paths. (e.g. /tmp folder) However, if it should be addressed up front, it
24
-
would seem to make sense if this module had a neutral name and did fix ups in both directions.
28
+
was as Linux does not rely on as many environment variables to point to platform-wide standard paths. (e.g. /tmp folder)
29
+
30
+
31
+
I have addressed the issue as bi-directional in this RFC, but would be quick to back off to Dev on Windows => Run on Linux if the other way seems not worth the effort.
32
+
If both directions were desirable upfront, it would seem to make sense if this module had a neutral name and did fix ups in both directions -
33
+
unless that would make the code too complex - then perhaps a module per "interop direction".
25
34
26
35
I also want to full acknowledge that this type of support is not appropriate to compile right into the PowerShell code itself - as it would seem to then be attempting
27
36
to "windowize" the Linux platform and would be confusing for Linux professionals and organizations who might adopt PowerShell to manage pure Linux environments.
28
37
29
38
## Motivation
30
39
31
40
As an administrator who wishes to start managing Linux with PowerShell,
32
-
I can port Windows scripts, snippets and modules that contain popular Windows references (usually environment variables) to Linux without changing every reference
33
-
so that I can save work by reuse as much of my Windows PowerShell code as possible, and where desirable, create scripts that run on both Windows and Linux unmodified.
41
+
(or vice versa) I can port scripts, snippets and modules that that contain
42
+
popular references on my initial development platform (eg environment variables)
43
+
to the other platform without changing every reference, so that I can save work
44
+
by reusing as much of my initial platform PowerShell code as possible, and
45
+
where desirable, create scripts that run on both Windows and Linux unmodified.
34
46
35
47
## Specification
36
48
37
49
- Standard shipped-with PowerShell Core module
38
50
- Written as a script
39
-
- That "fixes up" a Linux environment
40
-
- with common Windows standard pointers
41
-
- or code samples for common things that need to be done
51
+
- That "fixes up" a target environment (Windows or PowerShell)
52
+
- with common standard pointers
53
+
- or code samples for common things that need to be done from the "developed on" platform
42
54
- including code samples of methods that simply work on both platforms unchanged
43
55
- that requires some action from an administrator to enable (e.g. run a CMDLet in their script or a machine based profile)
44
56
45
57
###example
46
58
Only tested on CentOS - so may need improvement for other distros
47
59
48
-
~~~~
60
+
~~~~PowerShell
61
+
#Code that adapts Windows PowerShell to Linux
49
62
$RunningOnWindows = $true
50
63
If ((Test-Path variable:IsWindows) -AND !$IsWindows)
0 commit comments