Powershell Error when trying to delete a single document

Hello,
I am trying to delete a single file named test in my library named testtesttest and I am not able to do so with Powershell. Could someone assist?
$web = get-spweb "http://Webapp/sites/knowledgebase/test3/"
$list = $web.lists["testtesttest"]
$item = $list.item | ?{$_.name -eq "test"}
$item.delete()

Name in a library includes the FileExtension as well. Also, the script should be something like below:
$spAssgn = Start-SPAssignment;
$web = Get-SPWeb "<URL>" -AssignmentCollection $spAssgn;
$list = $web.Lists["testtesttest"];
$item = $list.Items|?{$_.Name -eq "test.docx"};
#Check if $item exists and is not null
if($item){
$list.GetItemById($item.ID).Delete();
Stop-SPAssignment $spAssgn;
This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

Similar Messages

  • What can be done to avoid getting the following error when trying to delete unused clips he operation could not be completed.  *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil

    what can be done to avoid getting the following error when trying to delete unused clips in Imovie 09 "the operation could not be completed.  *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil"  I use to get these type of error messages when trying to delete unsused clips from a large event 60 minutes or longer, but now I get this message when trying to reduce a 4 minute event.
    Also, does anyone know if there is a limit to the total amount of space that can be taken up by Projects in Imovie 09
    Thanks for any help

    Zachy,
    It goes something like this...
    Put your new drive in the enclosure. Use Disk Utility to format it, etc. I'd give it a slightly different name than the original. Let's say you have Old Disk and New Disk as your drive names. Use Carbon Copy Cloner to copy Old Disk to New Disk. Now you should have an exact copy, which you can test by rebooting and holding down the Option key. Choose New Disk from the list and let it boot, make sure all is well.
    Shut down and physically swap the drives. Take Old Disk and put it in the enclosure. Now your system has a new disk with a lot more space and you can reformat your old disk and just use it for large files or whatever.

  • OVM 3: error when trying to delete a virtual machine

    Hi,
    I enclose below the error when trying to delete, using OVM MANAGER, a VM that has been wrongly created.
    Thanks for you help.
    Job Construction Phase
    begin()
    com.oracle.odof.exception.ObjectException: Caught during invoke method: com.oracle.ovm.mgr.api.exception.IllegalOperationException: OVMAPI_2007E Find object name: (0}, class: interface com.oracle.ovm.mgr.api.virtual.VirtualMachine, returned null
    Wed Mar 21 14:42:20 CET 2012
    at com.oracle.odof.core.BasicWork.invokeMethod(BasicWork.java:151)
    at com.oracle.odof.command.InvokeMethodCommand.process(InvokeMethodCommand.java:100)
    at com.oracle.odof.core.BasicWork.processCommand(BasicWork.java:81)
    at com.oracle.odof.core.TransactionManager.processCommand(TransactionManager.java:751)
    at com.oracle.odof.core.WorkflowManager.processCommand(WorkflowManager.java:401)
    at com.oracle.odof.core.WorkflowManager.processWork(WorkflowManager.java:459)
    at com.oracle.odof.io.AbstractClient.run(AbstractClient.java:42)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: com.oracle.ovm.mgr.api.exception.IllegalOperationException: OVMAPI_2007E Find object name: (0}, class: interface com.oracle.ovm.mgr.api.virtual.VirtualMachine, returned null
    Wed Mar 21 14:42:20 CET 2012
    at com.oracle.ovm.mgr.api.manager.OvmManagerImpl.deleteObject(OvmManagerImpl.java:393)
    at com.oracle.ovm.mgr.api.manager.OvmManagerImpl.deleteObject(OvmManagerImpl.java:382)
    at com.oracle.ovm.mgr.api.system.FoundryDbImpl.deleteVirtualMachine(FoundryDbImpl.java:1302)
    at com.oracle.odof.core.AbstractVessel.invokeMethod(AbstractVessel.java:247)
    at com.oracle.odof.core.AbstractVessel.invokeMethod(AbstractVessel.java:207)
    at com.oracle.odof.core.BasicWork.invokeMethod(BasicWork.java:136)
    ... 7 more
    Job Aborted from server, cleaning up client.

    HI,
    I had this - the recommended solution was to re-install the OVM manager.

  • On Windows Platform, encounters error when trying to open an Indesign document created from MAC

    Hi all,
    On Windows Platform, encounters error when trying to open an Indesign document in INDD format created from Mac. Error received "Either the file does not exist, you do not have permission, or the file may be in use by other application". I am currently using Adobe Indesign CC 9.2 Trial version.
    Kindly advise how can i open this document on windows platform and allows me to edit the document.
    Thanks!
    With Rgds,
    Fiona Choy

    Normally there is no problem to open any INDD opening on Windows, when created on the Mac.
    But Mac user are often not aware on the naming limitations. A file name must not contain /, \, |, :
    It should not contain any extended character, it is not a primary problem but will be, if something links to that file, so avoid also: ÄÖÜäöüß+&
    You can use all other non A-Z a-z, 0-9 and - and  _
    I personally would also recommend to avoid spaces.
    This is valid for the INDD file itself but also for all linked content.

  • Getting No checksum error when trying to delete uploaded file

    When trying to delete an uploaded file I get the following error :-
    No checksum was provided to show processing for a page that requires a checksum when one or more request, clear cache, or argument values are passed as parameters.
    I have a tabular report displaying the uploaded files with one of the columns showing a delete icon.
    When you select the delete icon it has Column Link details of the following
    Link Text : <img src="#APP_IMAGES#del.gif">
    Link Attribute : &APP_ID.
    Target: URL
    Url:
    javascript:confirmFileDelete(htmldb_delete_message,'f?p=&APP_ID.:11:&SESSION.:REMOVE_ID:&DEBUG.::P11_DELETE_ID:#FILE_ID#');
    The above was working till I turned on the Session State Protection.
    I believe I need to add a checksum to my url via the pl/sql package apex_util.prepare_url but can someone please show me how to do from my URL????
    Thanks in advance
    Keith

    Keith,
    Why not do the following then...
    I think confirmDeleteFile is a custom function correct? As the second parameter, just pass in the file ID. Then in the function use JavaScript to set the value of P11_DELETE_ID to the file ID. Then call doSubmit('REMOVE_ID');
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Error when trying to delete a vendor from SC

    Hi all,
    I am encountering a problem when trying to delete a vendor from a contract and assign preferred vendor.
    The messages are
    "Enter exactly one partner of type preferred vendor"
    "Partner data couldnot be determined".
    In BBP_PD, I find two entries in partner table with partner_fct = 39.
    I am also not able to delete one of this entry.
    Please suggest.
    Thanks
    Nandalal

    Hi Nandlal,
    Can you see the business partner nos correctly for the vendors you are trying to assign?
    Are these vendors assigned to pur org?
    DO you get all greens in BBP_BP_OM_INTEGRATE?
    BR
    Dinesh

  • Error when trying to Cancel an invoice document via MR8M Transaction

    Greetings Everyone,
    l am having an issue when trying to cancel an invoice document via MR8M transaction. It gives me the following error message;
    SYSTEM ERROR: error in routine MRM_DRSEG_CR_CREATE
    Message no.M8008
    Procedure:
    Contact your system administrator.
    This invoice was related to a check payment. The check has been voided already and there is no clearing document for the accounting document. So, the item remains open. However when l try to reverse, it display the error message above.
    Thanks in advance

    read notes 449277 and 750455, your solution is probably there.

  • Error when trying to delete a query from production

    Hi Experts,
    When i tried to delete a query from <b>production system</b> using RSZDELETE, I am getting an error message like " Query object 42BYOKUXDNZBZKMC2VHR5Z19H is blocked. Deletion has been cancelled."
    i went to E071 table using SE16,and found out the transports which contains this particular object.This transports have returned error code 8.
    Can anyone help me on deleting this object entry from these requests?
    <b>How will I delete this particular object entry from these transport requests?</b>
    Thanks alot
    Shobin

    Hi Venkat,
    Thanks alot for your quick reply.
    I tried that also. But even those transports are not successful.
    I would like to know <b>what is the standard procedure to delete objects from a transport request in production</b>.
    Already, I unlocked the transport request to Modifiable status.
    Thanks alot
    Shobin

  • Weird Error when trying to delete a flickr album

    http://bayimg.com/GAkNMAAcn
    I tried to delete a linked flickr album created through aperture but got this error. No reaction when I click either button, I forced a quit and then tried to delete it again but the same thing happened.
    What should I do to delete the album?

    That's not an error message that you've posted - that's a dialog box asking you to confirm your deletion request. (Potentially 'saving you from yourself'.)
    That aside, the issue is that you can't actually carry out the deletion. A stuck object like this is possibly a good reason to run some [Library First Aid|http://support.apple.com/kb/HT3805]...
    Or... Have you done any independent album management over at Flickr? If you have, that might have broken the connection between Flickr and Aperture leading to this issue.
    Or... Is your software (operating system and Aperture) fully patched?
    Hope something here helps.
    Regards,
    Gary

  • S-1-1-0 Error when trying to delete folders on an NCP Server

    Hello:
    There are a couple of TIDS that point to this issue.
    The TID that references Windows 7 says "reported to Engineering"
    Problem:
    On trying to delete folders on an NCP Server (does not matter if you are admin or any other user) from a WIn 7 Client you get an error message about needing permission from S-1-1-0 in order to make changes to this folder.
    Seems to have been an issue with both XP and WIn 7 at one time but may have been resolved in XP.
    S-1-1-0 is the MS SID associated with the group Everyone which prior to XPSP2 included "anonymous" users.
    I am assuming that Win 7 follows the behaviour of post XP SP2 in not recognizing "anonymous" users as being members of Everyone thus the error message.
    Does anyone have the correct technical explanation for this problem. ?
    Renaming the folders allows you to delete them which makes me suspect that renaming alters a SID somewhere.

    Originally Posted by jmarton
    rdseepaul wrote:
    Thank you, jmarton, for your response.
    In our case we are using Client 2 SP2, so it looks like the "bugcat" came back.
    In fiddlying with it we have found that renaming a folder and all its sub folders that you may want to delete allows you to do so.
    > There are a couple of TIDS that point to this issue.
    > The TID that references Windows 7 says "reported to Engineering"
    > Problem:
    > On trying to delete folders on an NCP Server (does not matter if you
    > are admin or any other user) from a WIn 7 Client you get an error
    > message about needing permission from S-1-1-0 in order to make changes
    > to this folder.
    > Seems to have been an issue with both XP and WIn 7 at one time but may
    > have been resolved in XP.
    > S-1-1-0 is the MS SID associated with the group Everyone which prior
    > to XPSP2 included "anonymous" users.
    > I am assuming that Win 7 follows the behaviour of post XP SP2 in not
    > recognizing "anonymous" users as being members of Everyone thus the
    > error message.
    >
    > Does anyone have the correct technical explanation for this problem. ?
    There was a long standing problem with the Novell Client for Windows 7
    that wouldn't allow you to delete files which were read-only. An
    example would be some of the files located in a Windows roaming profile
    stored in a user's home directly on an OES2 server. The XP client
    would pop up a message asking if you wanted to do this, whereas on
    Windows 7 you could get the error about needing permission. Deleting
    from a command prompt worked ok.
    Fixes have gone into the latest Novell Client which should address
    this. Please make sure you are using Client 2 SP2.
    We're your Novell--again. re: focus
    Enhancement Requests: http://www.novell.com/rms

  • Error when trying to delete a work status option

    I am trying to delete one of our work states and I keep getting an error indicating the "operation has timed-out", has anyone seen this before?
    Thanks!

    Hi Amy,
    Whenever you try to delete a particular work state, it will delete all the work status related information from the database. This means that all the work status previously set for the transactional data will be lost. How many records do you have with teh work status set? You might be getting this error because there might be lot of records for whom the work status has been set.
    You might try to first take a bakup of all the work status related information from all the applications, then delete them. And then try to delete your work state.
    Hope this helps.

  • Get error when trying to delete email

    Can't delete email? Get "unable to move message - the message could not be moved to the mailbox trash" error when I do. How can I resolve? Thanks! sidavis

    Here is an article from the apple support website that might help out.
    http://support.apple.com/kb/TS2475

  • Script error when trying to delete group items

    Hello,
    I have the following part of my javascript:
    //loop to remove logos
    for (i=0; i<logoKeys.length; i++) {
    if (logosArray[logoKeys[i]] == false) changeLayer.groupItems.getByName(logoKeys[i]).remove();
    And I get the following error when any of the values are set to false:
    Line 64: if (logosArray[logoKeys[i]] == false) changeLayer.groupItems.getByName(logoKeys[i]).remove();
    an Illustrator error occurred: 1128353364 ('CANT')
    The script works fine when none of the values in logosArray are false, so it must be the part
    changeLayer.groupItems.getByName(logoKeys[i]).remove();
    that is giving me problems.
    I declare the values like this:
    var values = new Array();
    ..some declarations in here for first part of the array...
    values[6]=false;
    values[7]=true;
    values[8]=false;
    values[8]=false;
    values[10]=false;
    then later populate the logosArray:
    for (i=0; i<logoKeys.length; i++) {
    logosArray[logoKeys[i]] = values[offset];
    offset++;
    The interesting thing is if I change the population of logosArray to set all values implicitly to false, it also works fine:
    ie.
    for (i=0; i<logoKeys.length; i++) {
    logosArray[logoKeys[i]] = false;
    offset++;
    So it doesn't seem to like taking the values for logosArray from my values[] array. Any idea why? Any help is greatly appreciated. Thanks.

    Update:
    When I implicitly set the values of logosArray to "false" it only works every OTHER time I run the script. Is there any kind of cache or local memory dump I have to do on illustrator between running scripts?

  • Error when trying to delete data from 0Plant

    I am trying to delete the master data from 0Plant and get the following message:
    The system is unable to delete all of the specified m
    because some of it is still in use. (See log:       
    Object RSDMD, sub-object MD_DEL )                   
    Do you want to delete the data records that are no lo
    Is there a workaround? Thanks

    Hi Niten,
    You can delete the Master Data which are not used still. (As the SIDs are not mapped to the DIM Tables)
    Then regarding the used ones ::: If you upload the Masterdata again with modifications, it will overwrite and after the attribute chage run you will see the modified Master Data.Hope this will solve your problem
    regards
    Happy Tony

  • I am getting an unknown error when trying to download a word document from mail to pages, any help

    I am trying to download a word document from mail into pages and I keep getting an unknown error message, are there special settings for this? Any help much appreciated!

    Not there aren't any special settings for this. You just use the Open In feature to save the document into Pages. You could have a font in the document that Pages doesn't like, maybe something that you copied and pasted from somewhere into the document that went corrupt. But there is nothing special about the way that you save a Word document into Pages. You save it like you save any document or file into a compatible app.

Maybe you are looking for

  • Swap elements in 2d array

    I'm looking for a way to swap a user-defined length of elements in a 2-dimensional array between rows. All of my efforts so far only take the elements and move them within the same row. Basically I have a 2d array with 2 rows, and I want to take a fe

  • Designs for interface/implementation factory APIs

    I've been building a complex data store for geographical information based on JNDI. The store is basically working but I've been trying to make the API for programs accessing it more regular. I'm dissatisfied with the way that new objects for additio

  • Inner class inside a method - how does it access method's local variable?

    hello All: I've learnt that, an inner class, if defined inside a method, it can access the method's local variables, only when they are defined as "final". Anyone can help explain the rationale behind it? Thanks a lot! Sway

  • Hi Select for update no wait

    Hi All please anybody help me with an ex of select for update no wait. my requirement is i want to update one table , before updating i want to know is that table is using by some other.

  • Not able to login into presentations server

    Hi, I have installed OBIEE in my local machine. As a part of report creation I have created an rpd file and changed the NQSConfig.ini file as mentioned in http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/bi_admin/biadmin.html. Then I have re-st