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
pragma solidity ^0.5.15; | |
interface IERC20_v2 { | |
function totalSupply() external view returns (uint256); | |
function balanceOf(address _account) external view returns (uint256); | |
function transfer(address _to, uint256 _tokens) external returns (bool); | |
function approve(address _spender, uint256 _tokens) external returns (bool); | |
function transferFrom(address _from, address _to, uint256 _tokens) external returns (bool); | |
function allowance(address _account, address _spender) external view returns (uint256); |
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
pragma solidity ^0.5.15; | |
contract IERC20 { | |
function totalSupply() external view returns (uint256); | |
function balanceOf(address _account) external view returns (uint256); | |
function transfer(address _to, uint256 _tokens) external returns (bool); | |
function approve(address _spender, uint256 _tokens) external returns (bool); | |
function transferFrom(address _from, address _to, uint256 _tokens) external returns (bool); | |
function allowance(address _account, address _spender) external view returns (uint256); |
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
pragma solidity ^0.5.0; | |
contract Mul | |
{ | |
function Mul_v1(uint[50] calldata array, uint i, uint j) external pure returns(uint c) { return array[i] * array[j]; } | |
function Mul_v2(uint[50] memory array, uint i, uint j) public pure returns(uint c) { return array[i] * array[j]; } | |
function Mul_v3(uint[50] memory array, uint i, uint j) internal pure returns(uint c) { return array[i] * array[j]; } | |
} | |
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
pragma solidity ^0.5.0; | |
contract IERC20 { | |
function totalSupply() public view returns (uint256); | |
function balanceOf(address _account) public view returns (uint256); | |
function transfer(address _to, uint256 _tokens) public returns (bool); | |
function approve(address _spender, uint256 _tokens) public returns (bool); | |
function transferFrom(address _from, address _to, uint256 _tokens) public returns (bool); | |
function allowance(address _account, address _spender) public view returns (uint256); |
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
[CmdletBinding()] | |
PARAM( | |
[Parameter(Mandatory=$false)][String] $UserCredentialPath = "C:\PS\Cred_User.xml", | |
[Parameter(Mandatory=$false)][String] $ComputerCredentialPath = "C:\PS\Cred_Comp.xml" | |
) | |
function Invoke-LocalAccount | |
{ | |
[CmdletBinding()] | |
PARAM( |
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
$Providers = [System.Runtime.InteropServices.Marshal]::BindToMoniker("ADs:") | |
ForEach ($Provider in $Providers) | |
{ | |
$Provider.GetType().InvokeMember("Name", "GetProperty", $null, $Provider, $null) | |
} |
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
#Exporting PSCredential to XML | |
$Password = ConvertTo-SecureString 'XXX' -AsPlainText -Force | |
$Credential = New-Object -TypeName System.Management.Automation.PSCredential('svc_prd', $Password) | |
$Credential | Export-Clixml -Path 'C:\PS\Cred.xml' | |
#Importing PSCredential from XML | |
#$Credential = [System.Management.Automation.PSCredential](Import-Clixml -Path 'C:\PS\Cred.xml') | |
#Converting password to PlainText (e.g., API Payload) | |
#$Password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Credential.Password)) |
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 Get-SCCMData | |
{ | |
[CmdletBinding()] | |
PARAM( | |
[Parameter(Mandatory=$true)][ValidateSet('AllDevices','HWModel')][String] $QueryName, | |
[Parameter(Mandatory=$true)][String] $CredentialPath, | |
[Parameter(Mandatory=$false)][String] $SQLInstance = 'MSSQLSERVER\SQL_PRD', | |
[Parameter(Mandatory=$false)][String] $DBName = 'SCCM_DB_PRD', | |
[Parameter(Mandatory=$false)][String[]] $QueryParam | |
) |
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
[CmdletBinding()] | |
PARAM( | |
[Parameter(Mandatory=$true)][String] $CredentialPath, | |
[Parameter(Mandatory=$true)][String] $Resource | |
) | |
try | |
{ | |
$Token = $null |
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
[CmdletBinding()] | |
PARAM( | |
[Parameter(Mandatory=$true)][String] $CredentialPath, | |
[Parameter(Mandatory=$true)][String] $Scope | |
) | |
try | |
{ | |
$Toekn = $null |