File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
src/Storage/Commands.Storage Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 18
18
- Additional information about change #1
19
19
-->
20
20
## Current Release
21
+ * Fix issue that Copy File cmdlet can't reuse source context in destination when not input -DestContext
22
+ - Start-AzureStorageFileCopy
21
23
* Support Static Website configuration
22
24
- Enable-AzureStorageStaticWebsite
23
25
- Disable-AzureStorageStaticWebsite
Original file line number Diff line number Diff line change @@ -188,8 +188,6 @@ internal IStorageFileManagement GetDestinationChannel()
188
188
189
189
if ( destChannel == null )
190
190
{
191
- AzureStorageContext context = null ;
192
-
193
191
if ( ContainerNameParameterSet == this . ParameterSetName ||
194
192
ContainerParameterSet == this . ParameterSetName ||
195
193
BlobFilePathParameterSet == this . ParameterSetName ||
@@ -198,14 +196,26 @@ internal IStorageFileManagement GetDestinationChannel()
198
196
FileFilePathParameterSet == this . ParameterSetName ||
199
197
UriFilePathParameterSet == this . ParameterSetName )
200
198
{
201
- context = this . GetCmdletStorageContext ( DestContext ) ;
199
+ if ( DestContext == null )
200
+ {
201
+ if ( Channel != null )
202
+ {
203
+ destChannel = Channel ;
204
+ }
205
+ else
206
+ {
207
+ destChannel = base . CreateChannel ( ) ;
208
+ }
209
+ }
210
+ else
211
+ {
212
+ destChannel = new StorageFileManagement ( this . GetCmdletStorageContext ( DestContext ) ) ;
213
+ }
202
214
}
203
215
else
204
216
{
205
- context = AzureStorageContext . EmptyContextInstance ;
217
+ destChannel = base . CreateChannel ( ) ;
206
218
}
207
-
208
- destChannel = new StorageFileManagement ( context ) ;
209
219
}
210
220
211
221
return destChannel ;
You can’t perform that action at this time.
0 commit comments