Move-item asks for path[0]

I have the following script that Im trying to use based on a posting from June Blender in 2013.
$archivedate = (Get-Date).AddDays(-61)
$files = get-childitem -recurse E:\ftp-folder\UFSI-VA-WAVE-back |
 where-object {$_.lastWriteTime -lt $ArchiveDate}
foreach ($file in $files)
 $newName = $file.fullname -Replace 'E:\\ftp-folder','F:\\archive'
 move-item -Destination $newname
when I run it, powershell gives me this:
cmdlet Move-Item at command pipeline position 1
Supply values for the following parameters:
Path[0]: PS C:\Scripts>
PS C:\Scripts> .\move-back61.ps1
cmdlet Move-Item at command pipeline position 1
Supply values for the following parameters:
Path[0]:
why doesn't it find the path of the current $file?
Thanks!
Steve

The original w2asw about renaming a file and no moving it as you are doing.
Here is the correct code for what you are doing:
$archivedate = (Get-Date).AddDays(-61)
$files = get-childitem -recurse E:\ftp-folder\UFSI-VA-WAVE-back |
where-object {$_.lastWriteTime -lt $ArchiveDate} |
move-item -Destination F:\archive
Just do it in the pipeline and it will be moved.
Don't use double slashes.
This will not preserve the folder structure at the target the same as you example.  To move file with folder structure use RoboCopy.
Post RC questions in the storage management forum.
RoboCopy  E:\ftp-folder\UFSI-VA-WAVE-back F:\archive *.8 -E -MinAGE 61 /MOV
¯\_(ツ)_/¯

Similar Messages

  • HT201272 I have purchased a movie and elected to download later; when I go to the iTunes store, it shows where it is purchased yet when I go to the movie it ask for it to be purchased, will I be charged twice for the movie I have not downloaded yet?

    I purchased the movie "Black Nativity" at midnight and selected to download later; it shows that the movie has been charged in my account for billing, however; I when I go to download the movie, it ask for it to be purchased versus download.  I would like to know if I will be charged again for the movie upon selecting  purchase movie?  I would like some direction as for how to download the movie that I already purchased.

    Clicking on its purchase price again may result in you being charged again. Does the Store > Check For Available Downloads menu option download it
    Or does it show under the Purchased link under Quicklinks on the right-hand side of the iTunes store homepage for downloading

  • Move page asking for iDisk password

    Hi everyone,
    I added a movie page to my iWeb website (hosted on .Mac with a personal domain). When browsing to the movie page, the browser asks for my iDisk password. I then turned off password protection in my .Mac System Preferences, but that doesn't seem to have made any difference.
    Any ideas?
    Cheers!

    Yes I do. Removing the password solves the problem. However, I would like to keep a password on the site, but not enter a password for the movies on the movie page, especially when the requested password is my iDisk password, not the site password!
    Cheers!

  • Always asks for Path[0] parameter: Split-Path -LiteralPath $variable -Leaf

    Good evening
    I have a very strange Problem: if I start this small script:
    $dir1="c:\test[1]\myfolder"
    $foldername = Split-Path -LiteralPath $dir1 -Resolve -Leaf
    Then powershell always asks:
    Cmdlet Split-Path at commandline Position 1
    Enter the value for the following parameter:
    Path[0]:
    What's wrong with my script? It should us $dir1 as Parameter for -LiteralPath
    Thanks a lot for any help,
    kind regards,
    Tom

    Thank you for your answer!,
    it's a Windows 2008R2 Server and Get-Host Returns Version : 2.0
    » -Leaf in V3 (and possible above) is in its own parameter set
    Outch...
    a more useful error message would be nice.
    So it is not possible to get the leaf from a path which contains Powershell Wildcards using 'prebuilt' Powershell commands? Such limitatations are very strange...
    Not in V2. You will either have to update to V3 or use the Regex approach that I showed in my previous post.
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • Netflix wont run movie is asking for firefox 3.0 or above witch i have?

    I have tryed a number of times to watch movies at Netflix .com,i keep getting a window that says i need firefox 3.0 or higher,when i went too the updater [if i read it right] says i have 7.0 .Folks,,,,,iam dumber then a box of hammers when it comes to making add ons and all the other ons work, so in lite of that please to keep any advice VARY SIMPLE thank you

    Hi I went too the'search'at the down load place ,,,typed in "user agent" then clicked on install and it did, it put it in the "tool menu"when i put the arrow on"user agent" a menu comes up that asks where i want it to run i indicate Firefox that didnt work then,a restart that didnt work. what or where did i goof up?
    thank you

  • HT1600 I tried to rent a movie on itunes and it asked for a security code. I have no idea what it is. It seems to be a 4 digit number but i've never set it up. How do I fix my problem? Thank you!

    Trying to figure out what the numerical code is for renting movies. I'm logged into iTunes and when I want to rent a movie it asks for a code.
    Any help is much appreciated...
    Bart

    Hi bart00
    Is asking your code from your Apple ID (what use on App Store etc.)

  • Newly purchased movie asks for authorization

    I just purchased a movie last night from iTunes (Tinker/Tailor/Soldier/Spy, HD).
    Today, attempting to watch via my Apple TV (2nd gen) home sharing, but it's asking for authorization.
    -- the movie DOES play on the computer directly
    -- I've tried deauthorizing/reauthorizing the computer. (iMac)
    -- Tried disconnecting home sharing & reconnecting.
    -- Tried upgrading Apple TV software (upgrade was successful, movie still asks for authorization)
    -- Other purchased movies play without problems.
    Any thoughts?

    I'd submit a bug report to the itunes customer support
    Apple - iTunes - Make Request for the iTunes Store
    www.apple.com/feedback/itunes.html 

  • I've authorized my iPhone on a Mac but when I go to play videos it asks for authorization again, only to tell me that I have authorized too many computers. Help!

    So I used my work Mac to authorize my iPhone so I can play music, but now that I want to play a movie it asks for authorization. I've already authorized that account! I don't understand why it's asking for authorization again when I want to play a movie. Plus, I can't access the iTunes store from my work computer, so I'm stuck until I go home to deauthorize my other computers. Why is this happening?

    Authorization does not apply to iphones.  Authorization is for computers.
    About iTunes Store authorization and deauthorization

  • Yosemite 10.10.2 server app. FTP help. I have a program running in my local server enviroment that wants to FTP to my mac folder. It asks for the server , name, password, port and path. what are they?

    So I have set up a localhost area in my Mac. I have the new server.app and I am running yosemite 10.10.2 .
    I have a program running in my local server enviroment that wants to FTP to my mac .
    It asks for the server , name, password, port and path. what are they?
    I am pretty certain that the Serveris "localhost",
    Name is my macs name (like my-mac-min)
    password is "my login password"
    and they suggest port 21.
    But what is the file path, lets just say my site is set up http://localhost/siteftp and is actually at my Users/Sites/siteftp folder.
    Why cant this program connect to the mac.
    Is it because they are both operating in the same localhost enviroment,
    could it be my folder permissions are not correct on siteftp folder?
    Help please !

    I tried turning the computer off and then back on. The alerts don't show the notice to update as resolved. Hopefully this is not a problem or an indicator or another problem. Should I ignore or reload 10.10.1 from the app store to trigger a resolved check in a green circle?
    Interesting that I had to buy server software after my free Yosemite download. I would have hoped that the two pieces of software would have gone together without any complication. It is not positive to end up buying a problem. Ah well, time to move on.

  • Asks for password every time I try to move a file into document folder.

    Say need authorization to move file into document folder. I have some scans on seek top and I want ot place in a diabetes folder, states needs password.
    I have 12 items I want to place in the folder, seems a bit too much of a security issue.
    The file are transferred data, it states file can not be modified, authenticate or cancel, I hit authenticate and then asked for a password. Since it may be files from a different pc or format, there must be a shortcut to make this simpler.

    Where's this folder located? Somewhere in your home folder? When you created this folder, were you logged in to the same user account as the one you are in now?

  • Keeps asking for my "local items" keychain

    Okay, this is getting nuts. Ever since I added icloud keychain to my iPhone, my mac has been incessantly asking for the "local items" password for every stinking native app I run. I mean, KEYCHAIN wants access to my local items keychain? I mean, COME ON!
    On average, I have to type the stupid password in about once every ten minutes. Mail, Messages, Keychain, Safari, back to Keychain. Well, how nice, iTunes doesn't want to be left out. Okay, Safari, didn't we just have this discussion?
    I have permanently unlocked the "login" keychain, and told it to never lock again (so, at least I'm not getting those anymore). Where in the world is the "local items" keychain, and why does it CONSTANTLY want to be unlocked?
    PS> adding insult to injury: CalendarAgent wants to use the (already unlocked) "login" keychain. Yes, repair keychain says there aren't any problems. I have also manually locked and unlocked the "login" keychain. DIsk Utility's repair permissions also comes back clean.

    Hi,
    I now have the Login keychain and the Local Items you talk about.
    The Login keychain uses the User Login password to unlock  when I start up the Mac and login.
    From what I can tell my Local Items Keychain uses the same password.
    However it seems the Login one is the default and right clicking it in the list in Keychain Access is the only one I can change the Password for.
    It seems I may be able to make the Local Items the default Keychain.
    However I also know that I have move some items from the Local Items to the Login keychain such as AIM accounts so that they work in Messages.
    9:11 pm      Tuesday; December 24, 2013
      iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • HT3775 I can not open a video movie clip, the system ask for a codec, how can a set up that automatlicly

    I can not open a video movie clip, the system ask for a codec, how can a set up automatlicly?

    The problem was resolved a small manipulation - on stage Basic Configuration,
    point 3 "Configure CA Introscope"
    I forgot to add to the list of CA Introscope Enterprise Managers link to my manager.
    Thus it is necessary to take into account that the path should be correct (usually for linux - /usr/sap/ccms/apmintroscope) and the directory should be applied appropriate privileges.
    Then in paragraph "Byte Code Adapter Installation" - there are all the necessary data, and it starts to work correctly

  • How do I move files from my iMac to my Airport without getting 'AirPort can not be modified' message. File sharing is enabled and I'm not getting asked for a password. Thanks

    How do I move files from my iMac to my Airport without getting 'AirPort can not be modified' message. File sharing is enabled and I'm not getting asked for a password. Thanks

    What OS are you running.. this is usually only a problem in Mavericks.
    If so I recommend you mount the hard disk manually..
    Use Go, Connect to server.
    Type in the IP address if static.. eg
    AFP://10.0.1.1
    Or the name.. but you will have issues unless the name is short, no spaces and pure alphanumeric.. if you are using bad names.. fix it by a full factory reset in airport utility and give it all names that comply to the above.
    Type in
    AFP://TCname.local Where TCname is replaced with the actual name.
    You will be asked for the password the first time which is public unless you changed it.. please remember to save this in the keychain.
    Copy files then to a new directory you create on the TC.. do not place files inside the TM sparsebundle. Nor directly under the main directory.

  • Itunes movies wont play on computer, itunes keeps asking for authorisation

    The movies in my itunes will not play on my computer. Itunes continaually asks for computer to be authorised, then once authorised it says that the computer is already authorised then asks for authorisation again. Movies will however play on ipad. Any suggestions?

    Click here and follow the instructions.
    (79617)

  • Self-contained movie asking for source files

    I have exported a final cut pro movie as a self-contained file, and after I deleted the source files, as my harddrive was jammed full, I am unable to burn the project onto a dvd. The file won't open in quicktime or final cut pro. It keeps asking for a source file to continue - HELP! It was a two hour movie that I am to be burning for XMas, and it has slipped out of my computer apparently. It was opening on its own without my harddrive connected before I deleted the source files, so I KNOW it was self-contained which is the only reason I deleted the files in the first place! Thoughts would be greatly appreciated.

    This is not a new problem. I have encountered it through many versions of QuickTime.
    Typically, it happens after I assemble a compilation of clips from various sources, including imported Windows Media files. I diligently check the "Save as a self-contained movie" option, which always indicates a file size larger than the "Save as reference movie" option -- for example, 1.7 MB vs. only 9.2 KB for a short clip. And yet, if I have discarded the original clip, QuickTime is unable to play some of the supposedly self-contained movies because it can't find the deleted source files. It's kind of maddening, especially when there's no way to recover the original clips.
    I haven't tracked this, but I suspect it might happen when a clip in one format is pasted into a movie without first converting it to QuickTime. Has anyone else noticed this possibility and tested it?

Maybe you are looking for

  • How to reset display settings? 120 hz over HDMI on 2014 MBPr makes screen go black

    Hi, I have a 15" 2014 MBPr with the 750m. Recently, I bought a TV, a vizio M422i-B1. One of my main reasons for buying the TV was to use it as a third display for my mac. I have two displays already connected, a 27 inch 1440 display over thunderbolt,

  • Is there a way to run firefox at a higher frame rate for those with monitors capable of 120hz?

    I noticed that IE is smooth as silk when browsing websites compared to firefox. Is there an add-on or a setting I can change so that I can take advantage of my monitor which runs at 120hz?

  • Why are fields in PDF blank on iPad?

    When I create an Adobe PDF form with fields that can be filled in, the form can be opened and seen on an iPad, but the fields that have been filled in are blank. Can this be corrected?

  • Adobe on mac?

    I had a PC and just bought a mac book pro. I'm taking classes online and use adobe to open up certain material, what program can I use on my mac that will open up the things I usually open up with adobe?

  • Security for file attachment

    Hi, Is there is any API available to secure file attachment. Initially i used AVCryptDoStdSecurity() API, but it is securing entire document itself instead of attachment how to handle file atttachment security? Please throw ur ideas on it!!!!!!! Rega