This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Powershell Function to Replace string in word file | |
function Replace-Word( | |
[string]$Document, | |
[string]$FindText, | |
[string]$ReplaceText | |
) | |
{ | |
$ReplaceAll = 2 | |
$FindContinue = 1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PowerShell Function to Rationalize data conditionaly (by Department eg) | |
Function Rationalize-DeptData{ | |
[CmdletBinding()] | |
[Parameter(Mandatory=$True, | |
ValueFromPipeline=$True, | |
ValueFromPipelineByPropertyName=$True)] | |
Param([string]$DepartmentName, [String]$InputSheetPath, [string]$OutputSheetPath ) | |
Import-Csv $InputSheetPath | Where-Object{$_.Department -eq $DepartmentName } | Sort-Object 'Application Name', 'Application Version' -Unique | Export-Csv $OutputSheetPath -NoTypeInformation -Append |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PowerShell function to rationalize application data based on certain conditions i.e. Hardware Drivers, Frewares etc | |
Function Rationalize-Conditional{ | |
[CmdletBinding()] | |
[Parameter(Mandatory=$True, | |
ValueFromPipeline=$True, | |
ValueFromPipelineByPropertyName=$True)] | |
Param([String]$InputSheetPath, [string]$OutputSheetPath ) | |
#if(Test-Path $OutputSheetPath){Remove-Item -Force} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PowerShell Function to Get MSI Properties. | |
Function Get-MsiDatabaseProperties () { | |
<# | |
.SYNOPSIS This function retrieves properties from a Windows Installer MSI database. | |
.DESCRIPTION This function uses the WindowInstaller COM object to pull all values from the Property table from a MSI | |
.EXAMPLE Get-MsiDatabaseProperties 'MSI_PATH' | |
.PARAMETER FilePath The path to the MSI you'd like to query | |
#> | |
[CmdletBinding()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''************************************************** | |
'vbscript function to delete outdated files | |
''************************************************** | |
'Usage Below | |
'strFolder = "C:\Windows\ccmcache" | |
'Set objFSO = CreateObject("Scripting.FileSystemObject") | |
'Set objFolders = objFSO.GetFolder(strFolder) | |
'strLogfile = "c:\windows\temp\ChacheFilesDelete.log" | |
'DeleteOutDatedFiles objFolders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Powershell function to check whether an MSI product code is installed or not | |
# Returns True/false | |
Function Test-MsiProductInstalled{ | |
param([string]$ProductCode) | |
$MsiInstance = @" | |
using System.Runtime.InteropServices; | |
using System; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function GetMSIProductCode(msi) | |
''************************************************* | |
' Return the Product Code from a given msi(filePath) | |
'************************************************* | |
On Error Resume Next | |
GetMSIProductCode="" | |
If msi = "" Then Exit Function End If | |
Dim FS, TS, WI, DB, View, Rec | |
Set WI = CreateObject("WindowsInstaller.Installer") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PowerShell Function to Get MSI Table. you can further export the table to csv | |
Function Get-MsiDatabaseTable () { | |
<# | |
.SYNOPSIS This function retrieves properties from a Windows Installer MSI database. | |
.DESCRIPTION This function uses the WindowInstaller COM object to pull all values from the Property table from a MSI | |
.EXAMPLE Get-MsiDatabaseProperties 'MSI_PATH' | |
.PARAMETER FilePath The path to the MSI you'd like to query | |
#> | |
[CmdletBinding()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'On error resume next | |
'**************************************************************************************** | |
' This is a template file used for Installtion of multiple msi's kept in various folder | |
' USAGE : Please Use the folderNames and 00_ , 01_ , 02_ ....and so on as prefix | |
' PLEASE UN-COMMENT Line#75 for actual Installtion. This is commented for a safety | |
' AUTHOR : Vikas Pandey | |
'**************************************************************************************** | |
'*** SET DEBUG | |
Dim Debug : Debug = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Please Save This file as HTA. This is a HTA Script to compare two excel files--> | |
<html> | |
<head> | |
<title>Excel Comparison Tool</title> | |
<HTA:APPLICATION | |
APPLICATIONNAME="Package Promotion Tool" | |
ID="PackagePromotionTool" | |
VERSION="1.0"/> | |
</head> |
OlderNewer