Posts

Showing posts with the label cmd

Enable NTFS rights editing of SqlBackup folder

Default behavior of sql server install is to lock down ability to set ntfs rights on sqlbackup folder to unlock this you have to run the following as admin. This will transfer ownership to administrator for subfolder takeown /f c:\sqlbackup /a /r /d y Use at your own risk

Pass array from cmd.exe batch to powershell script

Consider the following script: array as parameter.ps1 #requires -version 2.0 [CmdletBinding()] param ( [parameter(Mandatory=$false)] [string[]] $data ) write-host "items in data array:" $data.count write-host "first item in data array:" $data[0] When calling from command line cmd.exe using the following command powershell -file ".\array as parameter.ps1" -data "data1","data2" outputs items in data array: 1 first item in data array: data1,data2 But when calling using the folloing command powershell -command "&{.\'array as parameter.ps1' -data 'data1','data2'}" outputs items in data array: 2 first item in data array: data1