我有一个包含PDF的路径列表,例如:
Get-Content c:\copy\filelist.txt | Foreach-Object {
Copy-Item -Source $_.FullName -Destination "c:\copy\"
}
我试图将每个文件复制到一个目的地。我使用以下不起作用的脚本。
public class MainActivity extends FragmentActivity implements View.OnClickListener, BillingProcessor.IBillingHandler,
EmailCapturedListener {
private MyPagerAdapter pageAdapter;
private Button mDownloadResumeButton;
private ImageButton mRightArrow, mLeftArrow;
private static final String EMAILKEY = "email_key";
public static final String EDITSKU = "professional_editing_service_1499";
public static final String EMAILSKU = "resume_template_pro_99";
private static final String RBPEMAIL = "rbproeditor@gmail.com";
private static final String RBPPASSWORD = "Redhawks123";
public String customerEmailAddress;
我收到错误
无法将参数绑定到"路径"因为它是空的
答案 0 :(得分:2)
使用Get-Content
时,它返回一个字符串数组,而不是文件项。这应该有效,假设每行包含一个文件名。
Get-Content c:\copy\filelist.txt | Foreach-Object { copy-item -Path $_ -destination "c:\copy\" }
或@Kiran说:
Get-Content C:\copy\filelist.txt | Copy-Item -Destination:"C:\copy"
答案 1 :(得分:0)
谢谢你们,我明白了,
Get-Content c:\copy\filelist.txt | Foreach-Object { copy-item -Path $_ -Destination "c:\copy\"}