Forum Discussion

María José Pedreira's avatar
María José Pedreira
Brass Contributor
Apr 26, 2017

Upload Published Files using Add-PnPFile

Hi all,


I have to upload a file and next command works fine:

 

Add-PnPFile -Path $file -Folder "/Pages" -Web $subweb -Values @{Title=$subweb.Title}


After upload the file, I get information about the file state. The file is checked out for me.
I try to use next command to publish it (using -Publish flag), but I get a message telling that the file is checked out and then it can't be published

 

Add-PnPFile -Path $file -Folder "/Pages" -Web $subweb -Values @{Title=$subweb.Title} -Publish

I dont see any flag related with CheckIn File action ¿How I can to upload a file with state Published?

 

Thank you!

Resources