Wednesday, 11 January 2017

Powershell Script to check file exist or not ([IO.Directory])

if([IO.Directory]::Exists($DestinationPath1))
{
write-output "Destination folder exists"
}
else
{
$DestinationPath1= New-item -type directory D:\**\$(get-date -f dd.MM.yyyy)\ -ErrorAction SilentlyContinue                      
}

Powershell to create log file


##LOGFILE CREATION

$LogFile = "D:\**.log"
function Logw([string]$var)
    {
    $Date =(Get-date).ToString();
    $Date + $var | out-file $LogFile -append -encoding utf8
    }

PowerShell Creating Time Stamp with date


##TIMESTAMP CREATION

$ScripName = "   "
$ydt = get-date -date $(get-date).adddays(-1) -format yyyyMMdd
$dt = date -f yyyyMMdd
$timeStamp= $(get-date -f MM-dd-yyyy_HH_mm_ss)
$path = "D:\\LOGS\$timeStamp"
if([IO.Directory]::Exists($path))
{
write-output "The folder exists"
}
else
{
$folCreate= New-item -type directory D:\LOGS\$(get-date -f MM-dd-yyyy_HH_mm_ss)
}

Monday, 9 January 2017

Dynamically specifying source location for Hyperlink in excel


TO FIND LOCATION OF EXCEL FILE :

=MID(CELL("filename"),1,FIND("[",CELL("filename"))-1)

CONCATENATING FILE LOCATION AND FILE NAME:

=HYPERLINK(P10&"index.html")

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...