├── test
├── automation
│ ├── .gitignore
│ ├── automationcase.ps1
│ ├── SHiPSTest
│ │ ├── SHiPSTest.psd1
│ │ └── SHiPSTest.psm1
│ ├── abc.psm1
│ ├── sampleRecursion.psm1
│ └── ctor.psm1
├── adhoc
│ └── adhoc1.psm1
├── Azure.Network
│ ├── Azure.Network.psm1
│ └── Azure.Network.psd1
└── Azure.Compute
│ ├── Azure.Compute.psm1
│ └── Azure.Compute.psd1
├── docs
├── images
│ └── pie.png
├── README.md
└── PublicAPIsAndMore.md
├── src
├── signing
│ └── 35MSSharedLib1024.snk
├── p2f
│ ├── src
│ │ ├── Samples
│ │ │ ├── P2F_Sample1_NullProvider
│ │ │ │ ├── packages.config
│ │ │ │ ├── Items
│ │ │ │ │ └── NullItem.cs
│ │ │ │ ├── NullDrive.cs
│ │ │ │ ├── Paths
│ │ │ │ │ ├── NullPathResolver.cs
│ │ │ │ │ └── NullRootPathNode.cs
│ │ │ │ ├── NullProvider.cs
│ │ │ │ ├── Properties
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ │ └── P2F_Sample1_NullProvider.csproj
│ │ │ ├── P2F_Sample2_TypeProvider
│ │ │ │ ├── packages.config
│ │ │ │ ├── Properties
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ │ ├── TypeProvider.cs
│ │ │ │ └── P2F_Sample2_TypeProvider.csproj
│ │ │ └── P2F_Sample3_TypeProvider
│ │ │ │ ├── packages.config
│ │ │ │ ├── Properties
│ │ │ │ └── AssemblyInfo.cs
│ │ │ │ ├── TypeProvider.cs
│ │ │ │ ├── TypePathNode.cs
│ │ │ │ └── P2F_Sample3_TypeProvider.csproj
│ │ ├── CodeOwls.PowerShell
│ │ │ ├── CodeOwls.PowerShell.Paths
│ │ │ │ ├── IClearItemContent.cs
│ │ │ │ ├── nuget.config
│ │ │ │ ├── IMoveItem.cs
│ │ │ │ ├── ISetItemContent.cs
│ │ │ │ ├── IGetItemContent.cs
│ │ │ │ ├── CodeOwls.PowerShell.Paths.csproj
│ │ │ │ ├── IPathValue.cs
│ │ │ │ ├── IClearItem.cs
│ │ │ │ ├── ISetItem.cs
│ │ │ │ ├── IRemoveItem.cs
│ │ │ │ ├── IRenameItem.cs
│ │ │ │ ├── IInvokeItem.cs
│ │ │ │ ├── ICopyItem.cs
│ │ │ │ ├── Processors
│ │ │ │ │ ├── IPathResolver.cs
│ │ │ │ │ ├── PathResolverDecorator.cs
│ │ │ │ │ ├── PathResolverBase.cs
│ │ │ │ │ ├── PSProviderPathResolver.cs
│ │ │ │ │ └── IProviderContext.cs
│ │ │ │ ├── INewItem.cs
│ │ │ │ ├── Attributes
│ │ │ │ │ └── CmdletHelpPathIDAttribute.cs
│ │ │ │ ├── IPathNode.cs
│ │ │ │ ├── Extensions
│ │ │ │ │ └── PathStringExtensions.cs
│ │ │ │ ├── Exceptions
│ │ │ │ │ ├── NodeDoesNotSupportCmdletException.cs
│ │ │ │ │ ├── CopyOrMoveToExistingItemException.cs
│ │ │ │ │ ├── CopyOrMoveToNonexistentContainerException.cs
│ │ │ │ │ ├── CopyOrMoveItemInternalException.cs
│ │ │ │ │ ├── ProviderException.cs
│ │ │ │ │ ├── CopyOrMoveToDifferentContainerTypeException.cs
│ │ │ │ │ └── MamlHelpDocumentExistsButCannotBeLoadedException.cs
│ │ │ │ ├── PathValue.cs
│ │ │ │ └── PathNodeBase.cs
│ │ │ └── CodeOwls.PowerShell.Provider
│ │ │ │ ├── CollectionExtensions.cs
│ │ │ │ ├── CodeOwls.PowerShell.Provider.csproj
│ │ │ │ ├── NullDisposable.cs
│ │ │ │ └── Drive.cs
│ │ ├── Nuget
│ │ │ └── p2f.nuspec
│ │ ├── CodeOwls.AssemblyInfo.cs
│ │ └── CodeOwls.PowerShell.AssemblyInfo.cs
│ ├── README.md
│ └── LICENSE.md
├── Microsoft.PowerShell.SHiPS
│ ├── SHiPSParameters.cs
│ ├── Node
│ │ ├── SHiPSLeaf.cs
│ │ ├── PathNodeInfo.cs
│ │ ├── ProviderContext.cs
│ │ ├── PSObjectNodeService.cs
│ │ ├── SHiPSDirectory.cs
│ │ ├── ContentHelper.cs
│ │ ├── LeafNodeService.cs
│ │ └── SHiPSBase.cs
│ ├── SHiPSAttributeHandler.cs
│ ├── SHiPSProviderAttribute.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Microsoft.PowerShell.SHiPS.csproj
│ ├── Utility
│ │ └── ProgressTracker.cs
│ └── SHiPSConstants.cs
└── Modules
│ ├── SHiPS.psd1
│ └── SHiPS.formats.ps1xml
├── samples
├── AzurePSDrive
│ └── README.md
├── CimPSDrive
│ └── README.md
├── FamilyTreeInCSharp
│ ├── packages.config
│ ├── FamilyTreeInCSharp.psd1
│ ├── FamilyTreeInCSharp.sln
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── FamilyTreeInCSharp.cs
│ └── FamilyTreeInCSharp.csproj
├── FileSystem
│ ├── README.md
│ └── FileSystem.psm1
├── ShowProgress
│ ├── README.md
│ └── ShowProgress.psm1
├── Library
│ ├── README.md
│ └── Library.psm1
├── FamilyTree
│ ├── README.md
│ └── FamilyTree.psm1
└── DynamicParameter
│ └── README.md
├── tools
├── travis.sh
└── download.sh
├── .gitignore
├── .github
└── ISSUE_TEMPLATE.md
├── .travis.yml
├── CHANGELOG.md
├── LICENSE.txt
├── appveyor.yml
├── ThirdPartyNotices.txt
└── vs2015
└── SHiPS.sln
/test/automation/.gitignore:
--------------------------------------------------------------------------------
1 | # Auto generated test fixture
2 | Library.psm1
3 |
--------------------------------------------------------------------------------
/docs/images/pie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PowerShell/SHiPS/HEAD/docs/images/pie.png
--------------------------------------------------------------------------------
/src/signing/35MSSharedLib1024.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PowerShell/SHiPS/HEAD/src/signing/35MSSharedLib1024.snk
--------------------------------------------------------------------------------
/test/automation/automationcase.ps1:
--------------------------------------------------------------------------------
1 | new-psdrive -name kk -psprovider SHiPS -root Test#Root
2 | cd kk:
3 | dir
4 | get-module -ListAvailable
--------------------------------------------------------------------------------
/samples/AzurePSDrive/README.md:
--------------------------------------------------------------------------------
1 | [AzurePSDrive][AzurePSDrive] - Navigate Azure Resources Just Like a File System
2 |
3 | [AzurePSDrive]: https://github.com/PowerShell/AzurePSDrive
4 |
--------------------------------------------------------------------------------
/samples/CimPSDrive/README.md:
--------------------------------------------------------------------------------
1 | [CimPSDrive][CimPSDrive] - Navigate CIM Classes and Namespaces Just Like a File System
2 |
3 | [CimPSDrive]: https://github.com/PowerShell/CimPSDrive
4 |
--------------------------------------------------------------------------------
/samples/FamilyTreeInCSharp/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/p2f/src/Samples/P2F_Sample1_NullProvider/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/p2f/src/Samples/P2F_Sample2_TypeProvider/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/p2f/src/Samples/P2F_Sample3_TypeProvider/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/tools/travis.sh:
--------------------------------------------------------------------------------
1 | set -x
2 | ulimit -n 4096
3 |
4 | echo "TRAVIS_EVENT_TYPE value $TRAVIS_EVENT_TYPE"
5 |
6 |
7 | git submodule update --init
8 |
9 |
10 | pwsh -c "cd src; ./bootstrap.ps1; ./build.ps1 -framework "netstandard2.0" Release"
11 |
12 | sudo pwsh -c "Import-Module ./tools/setup.psm1; Invoke-SHiPSTest"
13 |
--------------------------------------------------------------------------------
/src/p2f/README.md:
--------------------------------------------------------------------------------
1 | # P2F
2 |
3 | The PowerShell Provider Framework (P2F) performs the heavy lifting for developing PowerShell Providers.
4 |
5 | # Cross-Platform, and Cross-PowerShell
6 |
7 | The P2F Framework now targets .NET Standard 2.0 and uses the PowerShellStandard.Library to support building providers that are cross-platform and work on PowerShell (3, 4), 5 and 6 ...
8 |
--------------------------------------------------------------------------------
/test/automation/SHiPSTest/SHiPSTest.psd1:
--------------------------------------------------------------------------------
1 | @{
2 | RootModule= 'SHiPSTest.psm1'
3 | ModuleVersion = '1.0.0'
4 | GUID = 'A5FE6B04-385F-470F-9347-66EB3645B466'
5 | Author = 'Microsoft Corporation'
6 | CompanyName = 'Microsoft Corporation'
7 | Copyright = '© Microsoft Corporation. All rights reserved.'
8 | Description = 'SHiPS Test'
9 | PowerShellVersion = '5.0'
10 | }
11 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/IClearItemContent.cs:
--------------------------------------------------------------------------------
1 | using CodeOwls.PowerShell.Provider.PathNodeProcessors;
2 |
3 | namespace CodeOwls.PowerShell.Paths
4 | {
5 | public interface IClearItemContent
6 | {
7 | void ClearContent(IProviderContext providerContext);
8 | object ClearContentDynamicParameters(IProviderContext providerContext);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/p2f/src/Samples/P2F_Sample1_NullProvider/Items/NullItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace ProviderFramework_1_TheNullProvider
7 | {
8 | public class NullItem
9 | {
10 | public override string ToString()
11 | {
12 | return "This is a null item.";
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/samples/FamilyTreeInCSharp/FamilyTreeInCSharp.psd1:
--------------------------------------------------------------------------------
1 | @{
2 | RootModule= 'FamilyTreeInCSharp.dll'
3 | ModuleVersion = '1.0.0'
4 | GUID = 'A5FE6B04-385F-470F-9347-66EB3645B433'
5 | Author = 'Microsoft Corporation'
6 | CompanyName = 'Microsoft Corporation'
7 | Copyright = '© Microsoft Corporation. All rights reserved.'
8 | Description = 'SHiPS Samples'
9 | PowerShellVersion = '5.0'
10 | }
11 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/IMoveItem.cs:
--------------------------------------------------------------------------------
1 |
2 | using CodeOwls.PowerShell.Provider.PathNodeProcessors;
3 |
4 | namespace CodeOwls.PowerShell.Provider.PathNodes
5 | {
6 | public interface IMoveItem
7 | {
8 | object MoveItemParameters { get; }
9 |
10 | IPathValue MoveItem(IProviderContext providerContext, string path, string movePath, IPathValue destinationContainer);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/ISetItemContent.cs:
--------------------------------------------------------------------------------
1 | using System.Management.Automation.Provider;
2 | using CodeOwls.PowerShell.Provider.PathNodeProcessors;
3 |
4 | namespace CodeOwls.PowerShell.Paths
5 | {
6 | public interface ISetItemContent
7 | {
8 | IContentWriter GetContentWriter(IProviderContext providerContext);
9 | object GetContentWriterDynamicParameters(IProviderContext providerContext);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/p2f/src/Samples/P2F_Sample1_NullProvider/NullDrive.cs:
--------------------------------------------------------------------------------
1 | using System.Management.Automation;
2 |
3 | namespace ProviderFramework_1_TheNullProvider
4 | {
5 | ///
6 | /// the drive class
7 | ///
8 | /// used by the NullProvider class to define the default drive
9 | /// for the provider
10 | ///
11 | public class NullDrive : CodeOwls.PowerShell.Provider.Drive
12 | {
13 | public NullDrive(PSDriveInfo driveInfo) : base(driveInfo)
14 | {
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Microsoft.PowerShell.SHiPS/SHiPSParameters.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Microsoft.PowerShell.SHiPS
4 | {
5 | ///
6 | /// These are PSBoundParameters to be used while PowerShell.Invoke().
7 | ///
8 | internal class SHiPSParameters
9 | {
10 | internal bool Force { get; set; }
11 | internal bool Verbose { get; set; }
12 | internal bool Debug { get; set; }
13 |
14 | internal Dictionary BoundParameters { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/IGetItemContent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Management.Automation.Provider;
5 | using System.Text;
6 | using CodeOwls.PowerShell.Provider.PathNodeProcessors;
7 |
8 | namespace CodeOwls.PowerShell.Paths
9 | {
10 | public interface IGetItemContent
11 | {
12 | IContentReader GetContentReader(IProviderContext providerContext);
13 | object GetContentReaderDynamicParameters(IProviderContext providerContext);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Microsoft.PowerShell.SHiPS/Node/SHiPSLeaf.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.PowerShell.SHiPS
2 | {
3 |
4 | ///
5 | /// Defines a type that represents a leaf node.
6 | ///
7 | public class SHiPSLeaf : SHiPSBase
8 | {
9 | ///
10 | /// Default C'tor.
11 | ///
12 | public SHiPSLeaf()
13 | {
14 | }
15 |
16 | ///
17 | /// C'tor.
18 | ///
19 | /// Name of the node.
20 | public SHiPSLeaf(string name) : base(name, isLeaf:true)
21 | {
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/p2f/src/Samples/P2F_Sample1_NullProvider/Paths/NullPathResolver.cs:
--------------------------------------------------------------------------------
1 | using CodeOwls.PowerShell.Paths.Processors;
2 | using CodeOwls.PowerShell.Provider.PathNodes;
3 |
4 | namespace ProviderFramework_1_TheNullProvider
5 | {
6 | ///
7 | /// the path node processor
8 | ///
9 | class NullPathResolver : PathResolverBase
10 | {
11 | ///
12 | /// returns the first node factory object in the path graph
13 | ///
14 | protected override IPathNode Root
15 | {
16 | get
17 | {
18 | return new NullRootPathNode();
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ###
2 | SHiPS Specific
3 | ###
4 |
5 | # Build results
6 | [Dd]ebug/
7 | [Dd]ebugPublic/
8 | [Rr]elease/
9 | [Rr]eleases/
10 | x64/
11 | x86/
12 | bld/
13 | [Bb]in/
14 | [Oo]bj/
15 | [Ll]og/
16 | out/
17 |
18 | # Visual Studio 2015 cache/options directory
19 | .vs/
20 |
21 | # MSTest test Results
22 | [Tt]est[Rr]esult*/
23 | [Bb]uild[Ll]og.*
24 |
25 | # NUNIT
26 | *.VisualState.xml
27 | test/*[Tt]est[Rr]esults.xml
28 | test/automation/*[Tt]est[Rr]esults.xml
29 | test/TestDir
30 | test/TestFile*
31 |
32 | # .NET Core
33 | project.lock.json
34 | project.fragment.lock.json
35 | artifacts/
36 | **/Properties/launchSettings.json
37 |
38 | # Auto generated
39 | tools/install-powershell.ps1
40 | packages/
--------------------------------------------------------------------------------
/src/p2f/src/Nuget/p2f.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | P2F
5 | $id$
6 | Code Owls LLC
7 | Code Owls LLC
8 | https://github.com/beefarino/p2f/blob/master/LICENSE.md
9 | https://github.com/beefarino/p2f
10 | https://avatars1.githubusercontent.com/u/325790?s=140
11 | true
12 | Framework for implementing PowerShell Providers.
13 |
16 | Copyright (c) 2014 Code Owls LLC, All Rights Reserved
17 | PowerShell Providers
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/Microsoft.PowerShell.SHiPS/Node/PathNodeInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CodeOwls.PowerShell.Provider.PathNodes;
3 |
4 | namespace Microsoft.PowerShell.SHiPS
5 | {
6 | ///
7 | /// A class containing the current node information.
8 | ///
9 | internal class PathNodeInfo
10 | {
11 | internal string Path { get; set; }
12 | internal string PathWithNoEndSlash { get; set; }
13 | internal IPathNode NodeObject { get; set; }
14 | internal List Children { get; set; }
15 |
16 | internal void Set(string path, IPathNode node, List children)
17 | {
18 | Path = path;
19 | PathWithNoEndSlash = path?.TrimEnd('/', '\\');
20 | NodeObject = node;
21 | Children = children;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/samples/FileSystem/README.md:
--------------------------------------------------------------------------------
1 | # Sample Provider - Modeling Windows File System
2 |
3 | ## Step 1- Install SHiPS
4 |
5 | Follow the instructions [in here][readme] to download and install the SHiPS.
6 |
7 | ## Step 2 - Review the sample code
8 |
9 | See the [FileSystem module][fs].
10 |
11 | ## Step 3 - Try it out
12 |
13 | ```powershell
14 | Import-Module SHiPS
15 | Import-Module .\samples\FileSystem
16 | New-PSDrive -Name FS -PSProvider SHiPS -Root FileSystem#Home
17 | cd FS:
18 | dir
19 | ```
20 |
21 | ## Key takeaways from this example
22 |
23 | - Unlike the [FamilyTree][ft], a tree structure, the FileSystem follows a recursion model from root to leaf.
24 | - We used a data field, `Hidden [object]$data` to pass down the context from parent node to child.
25 |
26 | [readme]: ../../README.md#Installing-SHiPS
27 | [fs]: FileSystem.psm1
28 | [ft]: ../FamilyTree
29 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
10 |
11 | Steps to reproduce
12 | ------------------
13 |
14 |
15 | Expected behavior
16 | -----------------
17 |
18 |
19 | Actual behavior
20 | ---------------
21 |
22 |
23 | Environment data
24 | ----------------
25 |
26 |
27 |
28 | ```powershell
29 | $PSVersionTable
30 | Get-Module SHiPS
31 | ```
32 |
33 |
34 |
35 | ```powershell
36 | $env:ACC_VERSION
37 | $env:ACC_LOCATION
38 | Get-Module SHiPS
39 | Get-Module AzurePSDrive
40 | ```
41 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 |
2 | language: cpp
3 |
4 | git:
5 | depth: 1000
6 |
7 | os:
8 | - linux
9 | - osx
10 | sudo: required
11 | dist: trusty
12 | osx_image: xcode8.1
13 |
14 | matrix:
15 | allow_failures:
16 | - os: osx
17 | fast_finish: true
18 |
19 |
20 | addons:
21 | artifacts:
22 | paths: $(ls ./../SHiPS.coreclr.zip | tr "\n" ":")
23 |
24 | install:
25 | - export PATH=~/.dotnet:$PATH
26 | # Default 2.0.0 Ruby is buggy
27 | # Default bundler version is buggy
28 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
29 | rvm install ruby-2.3.3;
30 | rvm --default use 2.3.3;
31 | fi
32 | - bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh)
33 | - pushd tools
34 | - chmod +x travis.sh
35 | - popd
36 |
37 | script:
38 | - echo "TRAVIS_EVENT_TYPE value $TRAVIS_EVENT_TYPE"
39 | - ./tools/travis.sh
40 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | CHANGELOG
2 | ========
3 | ## 0.8.1
4 | * Added Get-Content and Set-Content.
5 | ## 0.8.0
6 | * Switched to using .NET Standard 2.0 & PowerShellStandard.Library to allow a single cross-platform binary
7 | - It requires .NET 4.7.1 running on Windows PowerShell
8 |
9 | ## 0.7.5
10 | * Added error handling for unsupported provider cmdlets.
11 | ## 0.7.2
12 | * Bug fixes for 'dir -force' case.
13 | ## 0.7.1
14 | * Perf improvement. For providers using cached data, [SHiPSProvider(UseCache=$true)], 'dir -force' will only refresh the last node in the path.
15 | * Allowed to navigate home directory, e.g., 'dir ~' or 'cd ~' under SHiPS based provider drive.
16 | ## 0.7.0
17 | * Fixed forward slash issue on Linux.
18 | * Fixed Set-Location drive: path issue on Linux.
19 | ## 0.6.0
20 | * Fixed Test-Path cmdlet.
21 | * Updated SHiPS to build with .NET Core 2.0.5 to be in sync with pwsh.
22 | * Fixed SHiPS formats.ps1xml.
23 | ## 0.3.0
24 | * Big Bang
25 |
--------------------------------------------------------------------------------
/src/Microsoft.PowerShell.SHiPS/SHiPSAttributeHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace Microsoft.PowerShell.SHiPS
5 | {
6 | ///
7 | /// A helper class for getting SHiPSPropertyAttribute settings.
8 | ///
9 | internal class SHiPSAttributeHandler
10 | {
11 | private static SHiPSProviderAttribute defaultAttribute = new SHiPSProviderAttribute();
12 |
13 | internal static SHiPSProviderAttribute GetSHiPSProperty(Type type)
14 | {
15 | var descriptions = (SHiPSProviderAttribute[])type.GetTypeInfo().GetCustomAttributes(typeof(SHiPSProviderAttribute), inherit:true);
16 |
17 | if (descriptions.Length == 0)
18 | {
19 | // if a module does not specify any attributes, we use the default.
20 | return defaultAttribute;
21 | }
22 | return descriptions[0];
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Microsoft.PowerShell.SHiPS/SHiPSProviderAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Reflection.Emit;
4 |
5 | namespace Microsoft.PowerShell.SHiPS
6 | {
7 | ///
8 | /// This attribute is used on SHiPS' derived classes to mark proper actions that SHiPS
9 | /// is expected to take.
10 | ///
11 | [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
12 | public sealed class SHiPSProviderAttribute : Attribute
13 | {
14 | ///
15 | /// True, SHiPS does caching from Get-ChildItem; false otherwise.
16 | ///
17 | public bool UseCache { get; set; } = SHiPSBase.UseCacheDefaultValue;
18 |
19 | ///
20 | /// Gets and sets a flag specifying whether SHiPS needs to Write-Progress.
21 | /// True, SHiPS will call Write-Progress; false it is assumed module will call Write-Progress.
22 | ///
23 | public bool BuiltinProgress { get; set; } = SHiPSBase.BuiltinProgressDefaultValue;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/samples/FamilyTreeInCSharp/FamilyTreeInCSharp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FamilyTreeInCSharp", "FamilyTreeInCSharp.csproj", "{8DCEE402-C9D8-4678-A901-27FC0962B63E}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {8DCEE402-C9D8-4678-A901-27FC0962B63E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {8DCEE402-C9D8-4678-A901-27FC0962B63E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {8DCEE402-C9D8-4678-A901-27FC0962B63E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {8DCEE402-C9D8-4678-A901-27FC0962B63E}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) Microsoft Corporation
2 | All rights reserved.
3 |
4 | MIT License
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the Software), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Provider/CollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Management.Automation;
6 | using System.Text;
7 |
8 | namespace CodeOwls.PowerShell.Provider
9 | {
10 | public static class CollectionExtensions
11 | {
12 | public static string ToArgList(this Collection items)
13 | {
14 | if (null == items)
15 | {
16 | return "()";
17 | }
18 |
19 | return "(" + String.Join("), (", items.ToArray()) + ")";
20 | }
21 |
22 | public static string ToArgString(this PSObject o)
23 | {
24 | if (null == o)
25 | {
26 | return "";
27 | }
28 | return o.BaseObject.ToString();
29 | }
30 | public static string ToArgString(this object o)
31 | {
32 | if (null == o)
33 | {
34 | return "";
35 | }
36 | return o.ToString();
37 | }
38 |
39 |
40 |
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/p2f/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 |
4 |
5 | Copyright (c) 2014 Code Owls LLC
6 |
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 |
10 | of this software and associated documentation files (the "Software"), to deal
11 |
12 | in the Software without restriction, including without limitation the rights
13 |
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 |
16 | copies of the Software, and to permit persons to whom the Software is
17 |
18 | furnished to do so, subject to the following conditions:
19 |
20 |
21 |
22 | The above copyright notice and this permission notice shall be included in all
23 | copies or substantial portions of the Software.
24 |
25 |
26 |
27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28 |
29 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30 |
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 |
33 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34 |
35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 |
37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38 |
39 | SOFTWARE.
--------------------------------------------------------------------------------
/samples/ShowProgress/README.md:
--------------------------------------------------------------------------------
1 | # Sample Provider - Show Progress and Other Attributes
2 |
3 | ## Step 1- Install SHiPS
4 |
5 | Follow the instructions [in here][readme] to download and install the SHiPS.
6 |
7 | ## Step 2 - Review the sample code
8 |
9 | See the [ShowProgress module][sp].
10 |
11 | ## Step 3 - Try it out
12 |
13 | ```powershell
14 | Import-Module SHiPS
15 | Import-Module .\samples\ShowProgress
16 | new-psdrive -name n -psprovider SHiPS -root ShowProgress#NoBuiltinProgress
17 |
18 | cd n:
19 | dir
20 | dir -verbose
21 | ```
22 |
23 | ## Key takeaways from this example
24 |
25 | - By default SHiPS is not caching data returned from Get-ChildItem
26 | - Sometimes it can be slow when you accessing data store especially through the Internet, you may want to cache the data for better user experience. To do so, you can add an attribute to your class, e.g.,
27 |
28 | ```powershell
29 | [SHiPSProvider(UseCache=$true)]
30 | ```
31 | - By default SHiPS shows progress. However you can disable it by adding the following attribute:
32 |
33 | ```powershell
34 | [SHiPSProvider(BuiltinProgress= $false)]
35 | ```
36 | - If needed, you can add Write-Progress in your PowerShell module.
37 |
38 | [readme]: ../../README.md#Installing-SHiPS
39 | [sp]:ShowProgress.psm1
40 |
--------------------------------------------------------------------------------
/test/automation/SHiPSTest/SHiPSTest.psm1:
--------------------------------------------------------------------------------
1 | <#
2 | Assuming you have done clone. Now cd to SHiPS\test\automation folder. Try the following.
3 |
4 | Import-Module ..\..\src\out\SHiPS\SHiPS
5 | Import-Module .\SHiPSTest.psm1
6 | new-psdrive -name jj -psprovider SHiPS -root SHiPSTest#SHiPSTest
7 | cd jj:
8 | dir
9 |
10 | #>
11 |
12 | using namespace Microsoft.PowerShell.SHiPS
13 | $script:PowerShellProcessName = if($IsCoreCLR) {'pwsh'} else{ 'PowerShell'}
14 |
15 |
16 | class SHiPSTest : SHiPSDirectory
17 | {
18 |
19 | SHiPSTest([string]$name): base($name)
20 | {
21 | }
22 |
23 | [object[]] GetChildItem()
24 | {
25 |
26 | $obj = @()
27 |
28 | Write-verbose "You should see this verbose message without -verbose!!" -Verbose
29 |
30 | $ps = get-process $script:PowerShellProcessName
31 | $obj += [SHiPSTestLeaf]::new($ps[0].Name);
32 |
33 | Write-debug "hello debuggggggggggggggggggggg!!"
34 |
35 |
36 | $obj += [SHiPSTest]::new("SHiPSTest");
37 | $obj += "SHiPSTest222"
38 |
39 |
40 | Write-verbose "hello you have used -verbose!!"
41 |
42 | return $obj;
43 | }
44 | }
45 |
46 |
47 | class SHiPSTestLeaf : SHiPSLeaf
48 | {
49 | SHiPSTestLeaf([string]$name): base($name)
50 | {
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/p2f/src/Samples/P2F_Sample1_NullProvider/Paths/NullRootPathNode.cs:
--------------------------------------------------------------------------------
1 | using CodeOwls.PowerShell.Provider.PathNodes;
2 |
3 | namespace ProviderFramework_1_TheNullProvider
4 | {
5 | ///
6 | /// the value factory class.
7 | ///
8 | /// used by P2F to manage items for a
9 | /// particular path value.
10 | ///
11 | class NullRootPathNode : PathNodeBase
12 | {
13 | private const string NodeName = "NullRootNode";
14 |
15 | ///
16 | /// supplies the item for the current path value
17 | ///
18 | /// the item it wrapped in either a PathValue instance
19 | /// that describes the item, its name, and whether it is
20 | /// a container.
21 | ///
22 | ///
23 | ///
24 | ///
25 | public override IPathValue GetNodeValue()
26 | {
27 | var item = new NullItem();
28 |
29 | return new LeafPathValue( item, Name );
30 | }
31 |
32 | ///
33 | /// supplies the name for the item at the current path value
34 | ///
35 | public override string Name
36 | {
37 | get { return NullRootPathNode.NodeName; }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/CodeOwls.PowerShell.Paths.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0
4 | CodeOwls.PowerShell.Paths
5 | true
6 | true
7 | ../../../../signing/35MSSharedLib1024.snk
8 | true
9 | false
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/IPathValue.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2014 Code Owls LLC
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to
6 | deal in the Software without restriction, including without limitation the
7 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 | sell copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 | IN THE SOFTWARE.
21 | */
22 |
23 |
24 |
25 |
26 | namespace CodeOwls.PowerShell.Provider.PathNodes
27 | {
28 | public interface IPathValue
29 | {
30 | object Item { get; }
31 | string Name { get; }
32 | bool IsCollection { get; }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Provider/CodeOwls.PowerShell.Provider.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0
4 | CodeOwls.PowerShell.Provider
5 | true
6 | true
7 | ../../../../signing/35MSSharedLib1024.snk
8 | true
9 | false
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/samples/Library/README.md:
--------------------------------------------------------------------------------
1 | # Sample Provider - Library
2 |
3 | ## Step 1- Install SHiPS
4 |
5 | Follow the instructions [in here][readme] to download and install the SHiPS.
6 |
7 | ## Step 2 - Review the sample code
8 |
9 | See the [Library module][fm].
10 |
11 | ## Step 3 - Try it out
12 |
13 | ``` powershell
14 | cd \SHiPS
15 | Import-Module SHiPS
16 | Import-Module .\samples\Library\Library.psm1
17 | new-psdrive -name M -psprovider SHiPS -root 'Library#Music'
18 |
19 | cd M:
20 | PS M:\> dir
21 |
22 | Directory: M:
23 |
24 | Mode Name
25 | ---- ----
26 | + Classic
27 | + Rock
28 |
29 | PS M:\> cd .\Classic\
30 | PS M:\Classic> Get-Content .\SwanLake
31 |
32 | Tchaikovsky's magical ballet tells ...
33 |
34 | PS M:\Classic>Set-Content .\Nocturnes -Value "Beautiful"
35 | PS M:\Classic> dir
36 |
37 | Directory: MM:\Classic
38 |
39 | Mode Name
40 | ---- ----
41 | . SwanLake
42 | . BlueDanube
43 | . Nocturnes
44 |
45 |
46 | PS M:\Classic> Get-Content .\Nocturnes
47 |
48 | Beautiful
49 |
50 | ```
51 |
52 | ## Key Takeaways from this example
53 |
54 | - Demonstrated how to use Get-Content and Set-Content cmdlet
55 | - Get-Content is supported on Leaf node only
56 | - Set-Content is supported on both Leaf and Directory. A child node is created under the current directory if the item does not exist.
57 |
58 | [readme]: ../../README.md#Installing-SHiPS
59 | [fm]: Library.psm1
60 |
--------------------------------------------------------------------------------
/src/p2f/src/Samples/P2F_Sample1_NullProvider/NullProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Management.Automation;
6 | using System.Management.Automation.Provider;
7 | using System.Text;
8 |
9 | namespace ProviderFramework_1_TheNullProvider
10 | {
11 | ///
12 | /// The provider class.
13 | ///
14 | [CmdletProvider("NullProvider", ProviderCapabilities.ShouldProcess)]
15 | public class NullProvider : CodeOwls.PowerShell.Provider.Provider
16 | {
17 | ///
18 | /// a required P2F override
19 | ///
20 | /// supplies P2F with the path processor for this provider
21 | ///
22 | protected override CodeOwls.PowerShell.Paths.Processors.IPathResolver PathResolver
23 | {
24 | get { return new NullPathResolver(); }
25 | }
26 |
27 | ///
28 | /// overridden to supply a default drive when the provider is loaded
29 | ///
30 | protected override Collection InitializeDefaultDrives()
31 | {
32 | return new Collection
33 | {
34 | new NullDrive(
35 | new PSDriveInfo( "Null", ProviderInfo, String.Empty, "Null Drive", null )
36 | )
37 | };
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Provider/NullDisposable.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2014 Code Owls LLC
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to
6 | deal in the Software without restriction, including without limitation the
7 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 | sell copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 | IN THE SOFTWARE.
21 | */
22 |
23 |
24 | using System;
25 | using System.Collections.Generic;
26 | using System.Linq;
27 | using System.Text;
28 |
29 | namespace CodeOwls.PowerShell.Provider
30 | {
31 | class NullDisposable : IDisposable
32 | {
33 | public void Dispose()
34 | {
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/IClearItem.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2014 Code Owls LLC
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to
6 | deal in the Software without restriction, including without limitation the
7 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 | sell copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 | IN THE SOFTWARE.
21 | */
22 |
23 |
24 |
25 |
26 | using CodeOwls.PowerShell.Provider.PathNodeProcessors;
27 |
28 | namespace CodeOwls.PowerShell.Provider.PathNodes
29 | {
30 | public interface IClearItem
31 | {
32 | object ClearItemDynamicParamters { get; }
33 | void ClearItem(IProviderContext providerContext, string path);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/ISetItem.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2014 Code Owls LLC
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to
6 | deal in the Software without restriction, including without limitation the
7 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 | sell copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 | IN THE SOFTWARE.
21 | */
22 |
23 |
24 |
25 |
26 | using CodeOwls.PowerShell.Provider.PathNodeProcessors;
27 |
28 | namespace CodeOwls.PowerShell.Provider.PathNodes
29 | {
30 | public interface ISetItem
31 | {
32 | object SetItemParameters { get; }
33 | IPathValue SetItem(IProviderContext providerContext, string path, object value);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/IRemoveItem.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2014 Code Owls LLC
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to
6 | deal in the Software without restriction, including without limitation the
7 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 | sell copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 | IN THE SOFTWARE.
21 | */
22 |
23 |
24 |
25 |
26 | using CodeOwls.PowerShell.Provider.PathNodeProcessors;
27 |
28 | namespace CodeOwls.PowerShell.Provider.PathNodes
29 | {
30 | public interface IRemoveItem
31 | {
32 | object RemoveItemParameters { get; }
33 | void RemoveItem(IProviderContext providerContext, string path, bool recurse);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/IRenameItem.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2014 Code Owls LLC
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to
6 | deal in the Software without restriction, including without limitation the
7 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 | sell copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 | IN THE SOFTWARE.
21 | */
22 |
23 |
24 |
25 |
26 | using CodeOwls.PowerShell.Provider.PathNodeProcessors;
27 |
28 | namespace CodeOwls.PowerShell.Provider.PathNodes
29 | {
30 | public interface IRenameItem
31 | {
32 | object RenameItemParameters { get; }
33 | void RenameItem(IProviderContext providerContext, string path, string newName);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/samples/FamilyTreeInCSharp/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FamilyTreeInCSharp")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FamilyTreeInCSharp")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("8dcee402-c9d8-4678-a901-27fc0962b63e")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0")]
37 |
--------------------------------------------------------------------------------
/src/p2f/src/CodeOwls.PowerShell/CodeOwls.PowerShell.Paths/IInvokeItem.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2014 Code Owls LLC
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to
6 | deal in the Software without restriction, including without limitation the
7 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 | sell copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 | IN THE SOFTWARE.
21 | */
22 |
23 |
24 |
25 |
26 | using System.Collections.Generic;
27 | using CodeOwls.PowerShell.Provider.PathNodeProcessors;
28 |
29 | namespace CodeOwls.PowerShell.Provider.PathNodes
30 | {
31 | public interface IInvokeItem
32 | {
33 | object InvokeItemParameters { get; }
34 | IEnumerable