Powershell: Enable cross providers support

Created on 7 Apr 2018  路  2Comments  路  Source: PowerShell/PowerShell

This is a feature request. Currently we do not have cross providers support in the pwsh. It can be useful for sceanrios like copy-item from a file handled by a filesystem provider and to the cloud storage or automation accounts etc, handled by SHiPS provider. For example,

PS Azure:\...\>  Copy-Item C:\test\hi.ps1 .\MyRunbook
Copy-Item : Source and destination path did not resolve to the same provider.
At line:1 char:2
+  Copy-Item C:\test\hi.ps1 .\MyRunbook
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (System.Collecti...[System.String]:Collection`1) [Copy-Item], PSArgumentException
    + FullyQualifiedErrorId : CopyItemSourceAndDestinationNotSameProvider,Microsoft.PowerShell.Commands.CopyItemCommand

Steps to reproduce


Expected behavior


Actual behavior


Environment data

> $PSVersionTable

Issue-Enhancement WG-Engine-Providers

Most helpful comment

Note: this is something we talked about doing a long time ago. At the time there wasn't a compelling scenario: copying files to reg keys was about the best we had. Now with Azure, copying to and from various Azure (and other cloud) stores makes a lot of sense. It's probably time to take a serious look at doing this.

All 2 comments

Note: this is something we talked about doing a long time ago. At the time there wasn't a compelling scenario: copying files to reg keys was about the best we had. Now with Azure, copying to and from various Azure (and other cloud) stores makes a lot of sense. It's probably time to take a serious look at doing this.

Another use case would be copying backup files to Google Cloud:
Copy-Item -LiteralPath 'filesystem::C:BackupsAdventureWorks2008R2.bak' -Destination 'gs:my-gc-bucketAdventureWorks2008R2.bak'

Was this page helpful?
0 / 5 - 0 ratings