Skip to content

Commit 5d65a13

Browse files
committed
RFC for PowerShell Core Interop Module
1 parent c7ae5b7 commit 5d65a13

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

1-Draft/RFCXXXX-PowerShell-Core-Interop-Module.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11

2-
32
RFC: RFC<four digit unique incrementing number - assigned by Committee>
3+
44
Author: Darwin Sanoy
5+
56
Status: Draft
7+
68
SupercededBy:
9+
710
Version: 0.1
11+
812
Area: Standard Modules
13+
914
Comments Due: 5/1/2017
1015
---
1116

@@ -17,35 +22,43 @@ I have written serveral debugging scripts which also run, unmodified, on Linux o
1722

1823
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.
1924

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
2126
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
2227
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".
2534

2635
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
2736
to "windowize" the Linux platform and would be confusing for Linux professionals and organizations who might adopt PowerShell to manage pure Linux environments.
2837

2938
## Motivation
3039

3140
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.
3446

3547
## Specification
3648

3749
- Standard shipped-with PowerShell Core module
3850
- 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
4254
- including code samples of methods that simply work on both platforms unchanged
4355
- that requires some action from an administrator to enable (e.g. run a CMDLet in their script or a machine based profile)
4456

4557
###example
4658
Only tested on CentOS - so may need improvement for other distros
4759

48-
~~~~
60+
~~~~PowerShell
61+
#Code that adapts Windows PowerShell to Linux
4962
$RunningOnWindows = $true
5063
If ((Test-Path variable:IsWindows) -AND !$IsWindows)
5164
{

0 commit comments

Comments
 (0)