Skip to content

Instantly share code, notes, and snippets.

function Send-FTP
{
<#
.SYNOPSIS
Upload files to FTP server
.DESCRIPTION
Upload files to a FTP address,
using System.Net.WebClient to connect to the FTP server
uploading to the given address
@DCAG
DCAG / Expand-ArchiveDotNet.ps1
Last active May 14, 2018 23:39 — forked from nachivpn/unzip.ps1
Unzip a file in powershell by overwriting existing files
function Expand-ArchiveDotNet{
<#
.SYNOPSIS
Expands an archive. Extract files contained.
.DESCRIPTION
Expand-Archive doesn't exist in powershell version 4 (only >= 5)
This is a .Net implementation of it.
.PARAMETER Path
@DCAG
DCAG / Get-ObjectPropertyRecursion.ps1
Last active December 15, 2017 22:16
blog - My script to inspect PowerShell objects - snippet 1
function Get-ObjectProperty {
param($InputObject, $Path="[ORIGIN]")
Get-Member -InputObject $InputObject | Where-Object {$_.MemberType -eq 'Property'} | `
Select-Object -ExpandProperty Name | Foreach-Object {
"[ORIGIN].$_ : $($InputObject.$_)"
Get-ObjectProperty -InputObject $InputObject.$_ -Path "$Path.$_"
}
}
@DCAG
DCAG / Sela2017practice02.py
Created November 19, 2017 00:11
classes exercise in python
class Grade:
"""
"""
def __init__(self, value, weight):
if 0 > value or 100 < value:
raise "Cannot create new Grade object. Grade value must be in range [0,100]"
# 0-100
self.value = value
if 1 > weight or 4 < weight:
raise "Cannot create new Grade object. Grade weight must be in range [1,4]"
@DCAG
DCAG / Sela2017practice01.py
Created November 12, 2017 00:14
four exercises in python
#
#
#
import math
print('1)')
L = [3, 7, 2]
Histo = ['*'*i for i in L]
print(Histo)