Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to delete OneDrive-tracked directories with Remove-Item #11721

Closed
rjmholt opened this issue Jan 29, 2020 · 3 comments
Closed

Unable to delete OneDrive-tracked directories with Remove-Item #11721

rjmholt opened this issue Jan 29, 2020 · 3 comments
Labels
Issue-Bug Issue has been identified as a bug in the product Resolution-Duplicate The issue is a duplicate. WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module

Comments

@rjmholt
Copy link
Collaborator

rjmholt commented Jan 29, 2020

See #11331.

Steps to reproduce

remove-item -force -recurse ./dir

Expected behavior

Folder is deleted

Actual behavior


ProviderInvocationException :
    ProviderInfo   : Microsoft.PowerShell.Core\FileSystem
    ErrorRecord    :
        Exception             :
            TargetSite :
                Name          : AppendFormatHelper
                DeclaringType : System.Text.StringBuilder
                MemberType    : Method
                Module        : System.Private.CoreLib.dll
            StackTrace :
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.Management.Automation.Internal.StringUtil.Format(String formatSpec, Object o)
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveDirectoryInfoItem(DirectoryInfo directory, Boolean recurse, Boolean force, Boolean rootOfRemoval)
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveItem(String path, Boolean recurse)
   at System.Management.Automation.SessionStateInternal.RemoveItem(CmdletProvider providerInstance, String path, Boolean recurse, CmdletProviderContext context)
            Message    : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
            Source     : System.Private.CoreLib
            HResult    : -2146233033
        CategoryInfo          : InvalidOperation: (:) [], FormatException
        FullyQualifiedErrorId : RemoveItemProviderException
    Message        : Attempting to perform the RemoveItem operation on the 'FileSystem' provider failed for path 'C:\Users\roholt\OneDrive - Microsoft\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin'. Index (zero based) must be greater than or equal to zero and less than the size of the argument
list.
    TargetSite     :
        Name          : RemoveItem
        DeclaringType : System.Management.Automation.SessionStateInternal
        MemberType    : Method
        Module        : System.Management.Automation.dll
    StackTrace     :
   at System.Management.Automation.SessionStateInternal.RemoveItem(CmdletProvider providerInstance, String path, Boolean recurse, CmdletProviderContext context)
   at System.Management.Automation.SessionStateInternal.RemoveItem(String providerId, String path, Boolean recurse, CmdletProviderContext context)
   at Microsoft.PowerShell.Commands.RemoveItemCommand.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
    InnerException :
        TargetSite :
            Name          : AppendFormatHelper
            DeclaringType : System.Text.StringBuilder
            MemberType    : Method
            Module        : System.Private.CoreLib.dll
        StackTrace :
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.Management.Automation.Internal.StringUtil.Format(String formatSpec, Object o)
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveDirectoryInfoItem(DirectoryInfo directory, Boolean recurse, Boolean force, Boolean rootOfRemoval)
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveItem(String path, Boolean recurse)
   at System.Management.Automation.SessionStateInternal.RemoveItem(CmdletProvider providerInstance, String path, Boolean recurse, CmdletProviderContext context)
        Message    : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
        Source     : System.Private.CoreLib
        HResult    : -2146233033
    Source         : System.Management.Automation
    HResult        : -2146233087
ProviderInfo                : Microsoft.PowerShell.Core\FileSystem
ErrorRecord                 :
    Exception             :
        TargetSite :
            Name          : AppendFormatHelper
            DeclaringType : System.Text.StringBuilder
            MemberType    : Method
            Module        : System.Private.CoreLib.dll
        StackTrace :
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.Management.Automation.Internal.StringUtil.Format(String formatSpec, Object o)
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveDirectoryInfoItem(DirectoryInfo directory, Boolean recurse, Boolean force, Boolean rootOfRemoval)
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveItem(String path, Boolean recurse)
   at System.Management.Automation.SessionStateInternal.RemoveItem(CmdletProvider providerInstance, String path, Boolean recurse, CmdletProviderContext context)
        Message    : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
        Source     : System.Private.CoreLib
        HResult    : -2146233033
    CategoryInfo          : NotSpecified: (:) [Remove-Item], FormatException
    FullyQualifiedErrorId : System.FormatException,Microsoft.PowerShell.Commands.RemoveItemCommand
    InvocationInfo        :
        MyCommand        : Remove-Item
        ScriptLineNumber : 1
        OffsetInLine     : 1
        HistoryId        : 34
        Line             : Remove-Item "$root/module/PowerShellEditorServices/bin" -Recurse -Force -Verbose
        PositionMessage  : At line:1 char:1
                           + Remove-Item "$root/module/PowerShellEditorServices/bin" -Recurse -For …
                           + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        InvocationName   : Remove-Item
        CommandOrigin    : Internal
    ScriptStackTrace      : at <ScriptBlock>, C:\Users\roholt\OneDrive - Microsoft\Dev\PowerShellEditorServices\PowerShellEditorServices.build.ps1: line 127
                            at *Task, C:\Users\roholt\Documents\PowerShell\Modules\InvokeBuild\5.4.1\Invoke-Build.ps1: line 526
                            at <ScriptBlock><End>, C:\Users\roholt\Documents\PowerShell\Modules\InvokeBuild\5.4.1\Invoke-Build.ps1: line 684
                            at <ScriptBlock>, <No file>: line 1
    PipelineIterationInfo :



TargetSite                  :
    Name          : Invoke
    DeclaringType : System.Management.Automation.Runspaces.PipelineBase
    MemberType    : Method
    Module        : System.Management.Automation.dll
StackTrace                  :
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.InvokeWithDebugger(IEnumerable`1 input, IList`1 output, PSInvocationSettings settings, Boolean invokeMustRun)
   at System.Management.Automation.ScriptDebugger.ProcessCommand(PSCommand command, PSDataCollection`1 output)
   at Microsoft.PowerShell.ConsoleHost.InputLoop.ProcessDebugCommand(String cmd, Exception& e)
Message                     : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Data                        : System.Collections.ListDictionaryInternal
InnerException              :
    TargetSite :
        Name          : AppendFormatHelper
        DeclaringType : System.Text.StringBuilder
        MemberType    : Method
        Module        : System.Private.CoreLib.dll
    StackTrace :
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.Management.Automation.Internal.StringUtil.Format(String formatSpec, Object o)
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveDirectoryInfoItem(DirectoryInfo directory, Boolean recurse, Boolean force, Boolean rootOfRemoval)
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveItem(String path, Boolean recurse)
   at System.Management.Automation.SessionStateInternal.RemoveItem(CmdletProvider providerInstance, String path, Boolean recurse, CmdletProviderContext context)
    Message    : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
    Source     : System.Private.CoreLib
    HResult    : -2146233033
Source                      : System.Management.Automation
HResult                     : -2146233087

Environment data


Name                           Value
----                           -----
PSVersion                      7.0.0-rc.2
PSEdition                      Core
GitCommitId                    7.0.0-rc.2
OS                             Microsoft Windows 10.0.19535
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

@rjmholt rjmholt added the Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a label Jan 29, 2020
@iSazonov iSazonov added WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module Issue-Bug Issue has been identified as a bug in the product and removed Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a labels Jan 30, 2020
@iSazonov
Copy link
Collaborator

.Net Core behavior dotnet/corefx#28124

@iSazonov iSazonov added the Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors label Jan 30, 2020
@iSazonov
Copy link
Collaborator

Dup #9246

@SteveL-MSFT SteveL-MSFT added Resolution-Duplicate The issue is a duplicate. and removed Up-for-Grabs Up-for-grabs issues are not high priorities, and may be opportunities for external contributors labels Jun 21, 2021
@ghost
Copy link

ghost commented Jun 22, 2021

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Jun 22, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Issue has been identified as a bug in the product Resolution-Duplicate The issue is a duplicate. WG-Cmdlets-Management cmdlets in the Microsoft.PowerShell.Management module
Projects
None yet
Development

No branches or pull requests

3 participants