Remove item from Programs and Features list in Windows 7
If the uninstallation of an program fails, the item will not be removed from the “Programs and Features” list on the Control Panel in Windows 7. To remove the item, remove the item from the
If the uninstallation of an program fails, the item will not be removed from the “Programs and Features” list on the Control Panel in Windows 7. To remove the item, remove the item from the
If you want to deploy a report (*.rdl) file to SQL Server Reporting Services in PowerShell, use the following script: PowerShell script "Set execution policy to [Unrestricted]" Set-ExecutionPolicy Unrestricted "Load assembly" [System.Reflection.Assembly]::LoadFrom("C:\Temp\Ada.Cdf.dll") "Create report"
If you want to use PowerShell to deploy a datasource in SQL Server Reporting Services use the following script: PowerShell script "Set execution policy to [Unrestricted]" Set-ExecutionPolicy Unrestricted "Load assembly" [System.Reflection.Assembly]::LoadFrom("C:\Temp\Ada.Cdf.dll") $datasource = New-Object
If you want to use PowerShell to create a folder in SQL Server Reporting Services use the following script: PowerShell script "Set execution policy to [Unrestricted]" Set-ExecutionPolicy Unrestricted "Load assembly" [System.Reflection.Assembly]::LoadFrom("C:\Temp\Ada.Cdf.dll") $folder = New-Object Ada.Cdf.Deployment.SSRS.Folder
In SSRS ther are two options you can set, when the credentials of the datasource are stored securely in the report server: Use as Windows crendentials when connecting to the datasource This option must be
If you want to make sure the first character of a string is one slash, use the function: public string PrependPath(string path, string firstCharacter) { return firstCharacter + path.TrimStart(firstCharacter.ToCharArray()); } To test the function
To dermine if a local user is member of a local group, before adding the user to the local group in PowerShell I use a C# class. The C# class could be converted to pure
If you want to list all members of the local computer group IIS_IUSRS with PowerShell, use this script: [Script] "Set execution policy to [Unrestricted]" Set-ExecutionPolicy Unrestricted $iisIUSRS = [ADSI]"WinNT://L014/IIS_IUSRS,group" "Loop members" foreach ($member in
NOTE In PowerShell 7 you can just call the *.ps1 script with named parameters like you would call a function inside a *.ps1 file. If you have a C:\Temp\MyScriptWithNamedParameters.ps1 file with the following content: param
You can concat strings in PowerShell by using the + operator, but like in C#, I think it is better to use a formatting approach by using the –f string operator: [-f operator] PS