Reemplazar el nombre (o parte de él) de varios ficheros a la vez con PowerShell

Podemos renombrar y reemplazar el titulo de nuestros ficheros, o parte de el, de forma rápida a través de PowerShell. Debemos acceder a la carpeta donde estan los ficheros y ejecutar el siguiente comando: get-childitem FILES_QUERY | foreach { Rename-Item -LiteralPath $_ $_.Name.Replace("TEXT_TO_REPLACE","TEXT_TO_APPEAR") } Donde FILES_QUERY es el selector de ficheros, TEXT_TO_REPLACE es el texto …

Sigue leyendo Reemplazar el nombre (o parte de él) de varios ficheros a la vez con PowerShell

Crear Team Site en SharePoint Online Sin Office 365 Group con PnP PowerShell

Para crear un Team Site sin que tenga un grupo de Office 365 asignado por defecto tan solo debemos específicar el template "STS#3" a la hora de crearlo. Ejemplo con PnP PowerShell: Connect-PnPOnline -Url https://MY_TENANT.sharepoint.com New-PnPTenantSite ` -Title "MY_SITE" ` -Url "https://MY_TENANT.sharepoint.com/sites/MY_SITE" ` -Owner "MY_USER@MY_TENANT.onmicrosoft.com" ` -Template "STS#3" ` -TimeZone 3 ` -Wait Para obtener …

Sigue leyendo Crear Team Site en SharePoint Online Sin Office 365 Group con PnP PowerShell

Empezar con SharePoint Online PnP PowerShell

Para poder utilizar los comandos de PnP en PowerShell necesitamos primero instalar un modulo. Abrimos Windows PowerShell y ejecutamos el comando: Install-Module SharePointPnPPowerShellOnline Y ya podemos comenzar a utilizarlo. El primer comando nos permitirá conectarnos a un Site: Connect-PnPOnline –Url https://yoursite.sharepoint.com –Credentials (Get-Credential) Si queréis utilizar el LogIn web (por ejemplo si ya habéis iniciado …

Sigue leyendo Empezar con SharePoint Online PnP PowerShell

Mostrar Mensaje de Confirmacion en PowerShell

$caption = "TITLE" $message = "MESSAGE" $yes = new-Object System.Management.Automation.Host.ChoiceDescription "&Yes","HELP_FOR_YES" $no = new-Object System.Management.Automation.Host.ChoiceDescription "&No","HELP_FOR_NO" $choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes,$no) $answer = $host.ui.PromptForChoice($caption,$message,$choices,0) if($answer -eq 0){ //YOUR_CODE_IF_YES }

Crear y añadir columnas a un Content Type via Power Shell

Nota: Al final de la explicación está el código entero para copy-paste. Nota: Si no lo ejecutamos directamente desde la SharePoint Management Shell debemos añadir su SnapIn: Add-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue 1. Declaramos el sitio web y el content type al que queremos añadir la columna $web = Get-SPWeb "YOUR_URL" $ctype = $web.contenttypes["YOUR_CONTENTTYPE"] 2. Declaramos …

Sigue leyendo Crear y añadir columnas a un Content Type via Power Shell