Frequently used Powershell cmdlets

Get-ChildItemdir, gci, lsGets the files and folders in a file system drive.Cmdlet
Invoke-CommandicmRuns commands on local and remote computers.Cmdlet
Import-ModuleipmoAdds modules to the current session.Cmdlet
Export-CsvepcsvConverts objects into a series of comma-separated (CSV) strings and saves the strings in a CSV file.Cmdlet
Write-HostWrites customized output to a host.Cmdlet
Get-WmiObjectgwmiGets instances of WMI classes or information about the available classes.Cmdlet
Get-Contentcat, gc, typeGets the contents of a file.Cmdlet
Get-DateGets the current date and time.Cmdlet
Invoke-WebRequestcurl, iwr, wgetGets content from a web page on the Internet.Cmdlet
Start-Processsaps, startStarts one or more processes on the local computer.Cmdlet
Copy-Itemcopy, cp, cpiCopies an item from one location to another.Cmdlet
Set-ExecutionPolicyChanges the user preference for the Windows PowerShell execution policy.Cmdlet
Out-FileSends output to a file.Cmdlet
Where-Object?, whereSelects objects from a collection based on their property values.Cmdlet
Import-CsvipcsvCreates table-like custom objects from the items in a CSV file.Cmdlet
Send-MailMessageSends an email message.Cmdlet
New-ObjectCreates an instance of a Microsoft .NET Framework or COM object.Cmdlet
Select-StringslsFinds text in strings and files.Cmdlet
Remove-Itemdel, erase, rd, ri, rm, rmdirDeletes files and folders.Cmdlet
Select-ObjectselectSelects objects or object properties.Cmdlet
Test-PathDetermines whether all elements of a file or directory path exist.Cmdlet
Invoke-RestMethodirmSends an HTTP or HTTPS request to a RESTful web service.Cmdlet
Install-PackageInstalls one or more software packages.Cmdlet
ForEach-Object%, foreachPerforms an operation against each item in a collection of input objects.Cmdlet
Write-Outputecho, writeSends the specified objects to the next command in the pipeline. If the command is the last command in thepipeline, the objects are displayed in the console.Cmdlet
Get-Processgps, psGets the processes that are running on the local computer or a remote computer.Cmdlet
Get-ServicegsvGets the services on a local or remote computer.Cmdlet
Format-TableftFormats the output as a table.Cmdlet
Test-ConnectionSends ICMP echo request packets (“pings”) to one or more computers.Cmdlet
New-ItemniCreates a new item.Cmdlet
Get-EventLogGets the events in an event log, or a list of the event logs, on the local or remote computers.Cmdlet
Get-WinEventGets events from event logs and event tracing log files on local and remote computers.Cmdlet
Install-ModuleDownloads one or more modules from an online gallery, and installs them on the local computer.Function
Enter-PSSessionetsnStarts an interactive session with a remote computer.Cmdlet
Get-CredentialGets a credential object based on a user name and password.Cmdlet
Read-HostReads a line of input from the console.Cmdlet
Get-AppxPackageGets a list of the app packages that are installed in a user profile.Cmdlet
Get-AclGets the security descriptor for a resource, such as a file or registry key.Cmdlet
Get-HelpDisplays information about Windows PowerShell commands and concepts.Cmdlet
Start-JobsajbStarts a Windows PowerShell background job.Cmdlet
Add-PSSnapinAdds one or more Windows PowerShell snap-ins to the current session.Cmdlet
New-PSSessionnsnCreates a persistent connection to a local or remote computer.Cmdlet
Invoke-ExpressioniexRuns commands or expressions on the local computer.Cmdlet
Add-ContentacAppends content, such as words or data, to a file.Cmdlet
New-PSDrivemount, ndrCreates temporary and persistent mapped network drives.Cmdlet
Move-Itemmi, move, mvMoves an item from one location to another.Cmdlet
Get-ItemgiGets files and folders.Cmdlet
Compare-Objectcompare, diffCompares two sets of objects.Cmdlet
Sort-ObjectsortSorts objects by property values.Cmdlet
Test-NetConnectionDisplays diagnostic information for a connection.Function
Set-AclChanges the security descriptor of a specified item, such as a file or a registry key.Cmdlet
Set-ContentscReplaces the contents of a file with contents that you specify.Cmdlet
Start-TranscriptCreates a record of all or part of a Windows PowerShell session to a text file.Cmdlet
Get-HotFixGets the hotfixes that have been applied to the local and remote computers.Cmdlet
Get-ItemPropertygpGets the properties of a specified item.Cmdlet
Add-MemberAdds custom properties and methods to an instance of a Windows PowerShell object.Cmdlet
Remove-AppxPackageRemoves an app package from a user account.Cmdlet
Rename-Itemren, rniRenames an item in a Windows PowerShell provider namespace.Cmdlet
Add-TypeAdds a.NET Framework type (a class) to a Windows PowerShell session.Cmdlet
Get-MembergmGets the properties and methods of objects.Cmdlet
ConvertTo-SecureStringConverts encrypted standard strings to secure strings. It can also convert plain text to secure strings. It isused with ConvertFrom-SecureString and Read-Host.Cmdlet
New-SelfSignedCertificateCreates a new self-signed certificate for testing purposes.Cmdlet
Start-SleepsleepSuspends the activity in a script or session for the specified period of time.Cmdlet
Restart-ComputerRestarts (“reboots”) the operating system on local and remote computers.Cmdlet
Out-GridViewogvSends output to an interactive table in a separate window.Cmdlet
Format-ListflFormats the output as a list of properties in which each property appears on a new line.Cmdlet
Set-ItemPropertyspCreates or changes the value of a property of an item.Cmdlet
Measure-ObjectmeasureCalculates the numeric properties of objects, and the characters, words, and lines in string objects, such asfiles of text.Cmdlet
Split-PathReturns the specified part of a path.Cmdlet
Get-CounterGets performance counter data from local and remote computers.Cmdlet
Get-CimInstanceGets the CIM instances of a class from a CIM server.Cmdlet
Add-ComputerAdd the local computer to a domain or workgroup.Cmdlet
Add-AppxPackageAdds a signed app package to a user account.Cmdlet
ConvertTo-HtmlConverts Microsoft .NET Framework objects into HTML that can be displayed in a Web browser.Cmdlet
Import-StartLayoutImports the layout of the Start into a mounted Windows image.Cmdlet
Set-Locationcd, chdir, slSets the current working location to a specified location.Cmdlet
Get-NetAdapterGets the basic network adapter properties.Function
Export-StartLayoutExports the layout of the Start screen.Cmdlet
Enable-PSRemotingConfigures the computer to receive remote commands.Cmdlet
Get-CommandgcmGets all commands.Cmdlet
Get-ExecutionPolicyGets the execution policies for the current session.Cmdlet
Join-PathCombines a path and a child path into a single path.Cmdlet
Import-PSSessionipsnImports commands from another session into the current session.Cmdlet
Get-FileHashComputes the hash value for a file by using a specified hash algorithm.Function
Write-ErrorWrites an object to the error stream.Cmdlet
Stop-ServicespsvStops one or more running services.Cmdlet
Stop-Processkill, sppsStops one or more running processes.Cmdlet
Start-ServicesasvStarts one or more stopped services.Cmdlet
Unblock-FileUnblocks files that were downloaded from the Internet.Cmdlet
Get-DiskGets one or more disks visible to the operating system.Function
Get-ModulegmoGets the modules that have been imported or that can be imported into the current session.Cmdlet
ConvertTo-JsonConverts an object to a JSON-formatted string.Cmdlet
New-WebServiceProxyCreates a Web service proxy object that lets you use and manage the Web service in Windows PowerShell.Cmdlet
Reset-ComputerMachinePasswordResets the machine account password for the computer.Cmdlet
Get-ScheduledTaskGets the task definition object of a scheduled task that is registered on the local computer.Function
Write-EventLogWrites an event to an event log.Cmdlet
Set-ServiceStarts, stops, and suspends a service, and changes its properties.Cmdlet
Out-StringSends objects to the host as a series of strings.Cmdlet
Get-PrinterRetrieves a list of printers installed on a computer.Function
Out-NullDeletes output instead of sending it down the pipeline.Cmdlet
Get-WindowsUpdateLogMerges Windows Update .etl files into a single log file.Function
Restart-ServiceStops and then starts one or more services.Cmdlet
Set-Variableset, svSets the value of a variable. Creates the variable if one with the requested name does not exist.Cmdlet
Compress-ArchiveCreates an archive, or zipped file, from specified files and folders.Function
ConvertFrom-JsonConverts a JSON-formatted string to a custom object.Cmdlet
New-SmbShareCreates an SMB share.Function
Set-ItemsiChanges the value of an item to the value specified in the command.Cmdlet
Update-HelpDownloads and installs the newest help files on your computer.Cmdlet
Group-ObjectgroupGroups objects that contain the same value for specified properties.Cmdlet
Start-BitsTransferCreates a BITS transfer job.Cmdlet
Get-CertificateSubmits a certificate request to an enrollment server and installs the response or retrieves a certificate for apreviously submitted request.Cmdlet
Register-ScheduledTaskRegisters a scheduled task definition on a local computer.Function
Tee-ObjectteeSaves command output in a file or variable and also sends it down the pipeline.Cmdlet
Test-ComputerSecureChannelTests and repairs the secure channel between the local computer and its domain.Cmdlet
Measure-CommandMeasures the time it takes to run script blocks and cmdlets.Cmdlet
ConvertFrom-SecureStringConverts a secure string to an encrypted standard string.Cmdlet
Get-JobgjbGets Windows PowerShell background jobs that are running in the current session.Cmdlet
Export-ClixmlCreates an XML-based representation of an object or objects and stores it in a file.Cmdlet
ConvertTo-CsvConverts objects into a series of comma-separated value (CSV) variable-length strings.Cmdlet
Remove-AppxProvisionedPackageRemoves an app package (.appx) from a Windows image.Cmdlet
New-ItemPropertyCreates a new property for an item and sets its value.Cmdlet
Get-PhysicalDiskGets a list of all PhysicalDisk objects visible across any available Storage Management Providers, or optionally afiltered list.Function
Set-TimeZoneSets the system time zone to a specified time zone.Cmdlet
Get-PackageReturns a list of all software packages that have been installed by using Package Management.Cmdlet
Get-SmbShareRetrieves the SMB shares on the computer.Function
Get-VariablegvGets the variables in the current console.Cmdlet
Add-PrinterAdds a printer to the specified computer.Function
Resolve-PathrvpaResolves the wildcard characters in a path, and displays the path contents.Cmdlet
Select-XmlFinds text in an XML string or document.Cmdlet
Get-RandomGets a random number, or selects objects randomly from a collection.Cmdlet
Get-PSDrivegdrGets drives in the current session.Cmdlet
Expand-ArchiveExtracts files from a specified archive (zipped) file.Function
Receive-JobrcjbGets the results of the Windows PowerShell background jobs in the current session.Cmdlet
New-NetFirewallRuleCreates a new inbound or outbound firewall rule and adds the rule to the target computer.Function
New-NetIPAddressCreates and configures an IP address.Function
Get-NetIPAddressGets the IP address configuration.Function
Register-ObjectEventSubscribes to the events that are generated by a Microsoft .NET Framework object.Cmdlet
Get-SmbConnectionRetrieves the connections established from the SMB client to the SMB servers.Function
New-TimeSpanCreates a TimeSpan object.Cmdlet
Enable-WindowsOptionalFeatureEnables a feature in a Windows image.Cmdlet
Set-NetConnectionProfileChanges the network category of a connection profile.Function
New-ScheduledTaskTriggerCreates a scheduled task trigger object.Function
Rename-ComputerRenames a computer.Cmdlet
Get-EventGets the events in the event queue.Cmdlet
Test-WSManTests whether the WinRM service is running on a local or remote computer.Cmdlet
Get-AppxProvisionedPackageGets information about app packages (.appx) in an image that will be installed for each new user.Cmdlet
Wait-ProcessWaits for the processes to be stopped before accepting more input.Cmdlet
Wait-JobwjbSuppresses the command prompt until one or all of the Windows PowerShell background jobs running in the sessionare completed.Cmdlet
Write-DebugWrites a debug message to the console.Cmdlet
Import-CertificateImports one or more certificates into a certificate store.Cmdlet
New-EventLogCreates a new event log and a new event source on a local or remote computer.Cmdlet
Get-HostGets an object that represents the current host program.Cmdlet
Invoke-WmiMethodCalls WMI methods.Cmdlet
Update-ScriptUpdates a script.Function
New-ServiceCreates a new Windows service.Cmdlet
ConvertFrom-CsvConverts object properties in comma-separated value (CSV) format into CSV versions of the original objects.Cmdlet
Invoke-ItemiiPerforms the default action on the specified item.Cmdlet
Enable-WSManCredSSPEnables CredSSP authentication on a computer.Cmdlet
Get-UniqueguReturns unique items from a sorted list.Cmdlet
Find-PackageFinds software packages in available package sources.Cmdlet
Out-HostohSends output to the command line.Cmdlet
Format-VolumeFormats one or more existing volumes or a new volume on an existing partition.Function
Format-CustomfcUses a customized view to format the output.Cmdlet
Get-SmbServerConfigurationRetrieves the SMB server configuration.Function
Mount-DiskImageMounts a previously created disk image (virtual hard disk or ISO), making it appear as a normal disk.Function
Clear-Hostclear, clsClears the display in the host program.Function
Start-DscConfigurationApplies configuration to nodes.Cmdlet
Get-SmbOpenFileRetrieves basic information about the files that are open on behalf of the clients of the SMB server.Function
Add-VpnConnectionAdds a VPN connection to the Connection Manager phone book.Function
Set-DnsClientServerAddressSets DNS server addresses associated with the TCP/IP properties on an interface.Function
Export-ModuleMemberSpecifies the module members that are exported.Cmdlet
Get-PSSessiongsnGets the Windows PowerShell sessions on local and remote computers.Cmdlet
Get-PSSnapinGets the Windows PowerShell snap-ins on the computer.Cmdlet
Get-NetConnectionProfileGets a connection profile.Function
Get-NetFirewallRuleRetrieves firewall rules from the target computer.Function
Push-LocationpushdAdds the current location to the top of a location stack.Cmdlet
Get-VolumeGets the specified Volume object, or all Volume objects if no filter is provided.Function
New-NetLbfoTeamCreates a new NIC team.Function
Get-NetTCPConnectionGets TCP connections.Function
Stop-ComputerStops (shuts down) local and remote computers.Cmdlet
Set-StrictModeEstablishes and enforces coding rules in expressions, scripts, and script blocks.Cmdlet
Set-NetFirewallRuleModifies existing firewall rules.Function
Add-AppxProvisionedPackageAdds an app package (.appx) that will install for each new user to a Windows image.Cmdlet
Enable-BitLockerEnables encryption for a BitLocker volume.Function
Get-Locationgl, pwdGets information about the current working location or a location stack.Cmdlet
Set-NetIPInterfaceModifies an IP interface.Function
New-VirtualDiskCreates a new virtual disk in the specified storage pool.Function
Remove-PSSessionrsnCloses one or more Windows PowerShell sessions (PSSessions).Cmdlet
Set-NetIPAddressModifies the configuration of an IP address.Function
Register-ScheduledJobCreates a scheduled job.Cmdlet
Set-SmbServerConfigurationSets the SMB Service configuration.Function
New-PartitionCreates a new partition on an existing Disk object.Function
Remove-PSDriverdrDeletes temporary Windows PowerShell drives and disconnects mapped network drives.Cmdlet
Remove-VariablervDeletes a variable and its value.Cmdlet
Get-WindowsOptionalFeatureGets information about optional features in a Windows image.Cmdlet
Import-ClixmlImports a CLIXML file and creates corresponding objects in Windows PowerShell.Cmdlet
Import-PfxCertificateImports certificates and private keys from a Personal Information Exchange (PFX) file to the destination store.Cmdlet
Uninstall-PackageUninstalls one or more software packages.Cmdlet
Set-AuthenticodeSignatureAdds an Authenticode signature to a Windows PowerShell script or other file.Cmdlet
Set-NetAdapterSets the basic network adapter properties.Function
Set-AliassalCreates or changes an alias for a cmdlet or other command element in the current Windows PowerShell session.Cmdlet
Set-WmiInstanceCreates or updates an instance of an existing Windows Management Instrumentation (WMI) class.Cmdlet
Disable-WindowsOptionalFeatureDisables a feature in a Windows image.Cmdlet
Update-ModuleDownloads and installs the newest version of specified modules from an online gallery to the local computer.Function
New-LocalUserCreates a local user account.Cmdlet
Mount-WindowsImageMounts a Windows image in a WIM or VHD file to a directory on the local computer.Cmdlet
Get-ItemPropertyValuegpvGets the value for one or more properties of a specified item.Cmdlet
New-AliasnalCreates a new alias.Cmdlet
New-JobTriggerCreates a job trigger for a scheduled job.Cmdlet
Get-Historyghy, h, historyGets a list of the commands entered during the current session.Cmdlet
New-CimSessionCreates a CIM session.Cmdlet
Get-LocalGroupGets the local security groups.Cmdlet
ConvertTo-XmlCreates an XML-based representation of an object.Cmdlet
New-PSSessionOptionCreates an object that contains advanced options for a PSSession.Cmdlet
Add-WindowsCapabilityInstalls a Windows capability package on the specified operating system image.Cmdlet
New-VariablenvCreates a new variable.Cmdlet
Convert-PathcvpaConverts a path from a Windows PowerShell path to a Windows PowerShell provider path.Cmdlet
Get-LocalGroupMemberGets members from a local group.Cmdlet
Add-WindowsPackageAdds a single .cab or .msu file to a Windows image.Cmdlet
Invoke-CimMethodInvokes a method of a CIM class.Cmdlet
ConvertFrom-StringCFSExtracts and parses structured properties from string content.Cmdlet
Export-CertificateExports a certificate from a certificate store into a file.Cmdlet
Unregister-ScheduledTaskUnregisters a scheduled task.Function
ConvertFrom-StringDataConverts a string containing one or more key and value pairs to a hash table.Cmdlet
Install-PackageProviderInstalls one or more Package Management package providers.Cmdlet
Get-LocalUserGets local user accounts.Cmdlet
Clear-ContentclcDeletes the contents of an item, but does not delete the item.Cmdlet
Remove-ModulermoRemoves modules from the current session.Cmdlet
Get-VpnConnectionRetrieves the specified VPN connection profile information.Function
Export-PfxCertificateExports a certificate or a PFXData object to a Personal Information Exchange (PFX) file.Cmdlet
Get-NetIPConfigurationGets IP network configuration.Function
Export-WindowsDriverExports all third-party drivers from a Windows image to a destination folder.Cmdlet
Grant-SmbShareAccessAdds an allow ACE for a trustee to the security descriptor of the SMB share.Function
Initialize-DiskInitializes a RAW disk for first time use, enabling the disk to be formatted and used to store data.Function
Get-NetIPInterfaceGets an IP interface.Function
Get-PfxCertificateGets information about .pfx certificate files on the computer.Cmdlet
Invoke-PesterInvokes Pester to run all tests (files containing *.Tests.ps1) recursively under the PathFunction
Add-OdbcDsnAdds an ODBC DSN.Function
Format-WidefwFormats objects as a wide table that displays only one property of each object.Cmdlet
Get-PartitionReturns a list of all partition objects visible on all disks, or optionally a filtered list using specifiedparameters.Function
Set-DiskTakes a Disk object or unique disk identifiers and a set of attributes, and updates the physical disk on thesystem.Function
Get-ScheduledJobGets scheduled jobs on the local computer.Cmdlet
Get-PnpDeviceReturns information about PnP devices.Function
Get-TpmGets an object that contains information about a TPM.Cmdlet
Disable-NetAdapterBindingDisables a binding to a network adapter.Function
Get-PSRepositoryGets PowerShell repositories.Function
Out-DefaultSends the output to the default formatter and to the default output cmdlet.Cmdlet
Add-PrinterDriverInstalls a printer driver on the specified computer.Function
Set-WinUserLanguageListSets the language list and associated properties for the current user account.Cmdlet
Get-ScheduledTaskInfoGets run-time information for a scheduled task.Function
Enable-NetFirewallRuleEnables a previously disabled firewall rule.Function
Out-PrinterlpSends output to a printer.Cmdlet
Add-PrinterPortInstalls a printer port on the specified computer.Function
Set-WinSystemLocaleSets the system locale (the language for non-Unicode programs) for the current computer.Cmdlet
Find-ModuleFinds modules from an online gallery that match specified criteria.Function
Get-NetAdapterVmqGets the VMQ properties of a network adapter.Function
Stop-TranscriptStops a transcript.Cmdlet
Get-SmbSessionRetrieves information about the SMB sessions that are currently established between the SMB server and theassociated clients.Function
Set-PSSessionConfigurationChanges the properties of a registered session configuration.Cmdlet
Add-MpPreferenceModifies settings for Windows Defender.Function
Set-SmbShareModifies the properties of the SMB share.Function
Set-VpnConnectionChanges the configuration settings of an existing VPN connection profile.Function
Start-ScheduledTaskStarts one or more instances of a scheduled task.Function
Suspend-BitLockerSuspends Bitlocker encryption for the specified volume.Function
Get-SmbShareAccessRetrieves the ACL of the SMB share.Function
Set-PSDebugTurns script debugging features on and off, sets the trace level, and toggles strict mode.Cmdlet
Get-StartAppsGets the names and AppIDs of installed apps.Function
Add-VpnConnectionRouteAdds a route to a VPN connection.Function
Get-VirtualDiskReturns a list of VirtualDisk objects, across all storage pools, across all providers, or optionally a filteredsubset based on provided criteria.Function
Write-InformationSpecifies how Windows PowerShell handles information stream data for a command.Cmdlet
New-ScheduledTaskCreates a scheduled task instance.Function
Set-CultureSets the user culture for the current user account.Cmdlet
New-ScheduledTaskSettingsSetCreates a new scheduled task settings object.Function
New-ScheduledTaskActionCreates a scheduled task action.Function
Set-PartitionSets attributes of a partition, such as active, read-only, and offline states.Function
Clear-VariableclvDeletes the value of a variable.Cmdlet
Add-KdsRootKeyGenerates a new root key for the Microsoft Group KdsSvc within Active Directory.Cmdlet
Exit-PSSessionexsnEnds an interactive session with a remote computer.Cmdlet
Add-LocalGroupMemberAdds members to a local group.Cmdlet
Set-LocalUserModifies a local user account.Cmdlet
Remove-ComputerRemoves the local computer from its domain.Cmdlet
New-NetNatCreates a NAT object.Function
Set-SmbClientConfigurationSets the SMB client configuration.Function
Set-ScheduledTaskModifies a scheduled task.Function
Remove-ItemPropertyrpDeletes the property and its value from an item.Cmdlet
Set-PrinterUpdates the configuration of an existing printer.Function
Set-PhysicalDiskSets attributes on a specific physical disk.Function
Set-DateChanges the system time on the computer to a time that you specify.Cmdlet
Repair-WindowsImageRepairs a Windows image in a WIM or VHD file.Cmdlet
Set-NetAdapterVmqSets the VMQ properties of a network adapter.Function
Remove-WmiObjectDeletes an instance of an existing Windows Management Instrumentation (WMI) class.Cmdlet
New-NetRouteCreates a route in the IP routing table.Function
Optimize-VolumeOptimizes a volume.Function
New-VolumeCreates a volume with the specified file system.Function
New-StoragePoolCreates a new storage pool using a group of physical disks.Function
New-SmbMappingCreates an SMB mapping.Function
Set-DscLocalConfigurationManagerApplies LCM settings to nodes.Cmdlet
New-ScheduledTaskPrincipalCreates an object that contains a scheduled task principal.Function
Get-CultureGets the current culture set in the operating system.Cmdlet
Set-PSRepositorySets values for a registered repository.Function
Set-NetFirewallProfileConfigures settings that apply to the per-profile configurations of the Windows Firewall with Advanced Security.Function
Get-AliasgalGets the aliases for the current session.Cmdlet
Get-DnsClientServerAddressGets DNS server IP addresses from the TCP/IP properties on an interface.Function
Set-MpPreferenceConfigures preferences for Windows Defender scans and updates.Function
Save-ModuleSaves a module locally without installing it.Function
Resize-PartitionResizes a partition and the underlying file system.Function
Repair-VolumePerforms repairs on a volume.Function
Remove-PrinterRemoves a printer from the specified computer.Function
Remove-PhysicalDiskRemoves a physical disk from a specified storage pool.Function
Remove-NetIPAddressRemoves an IP address and its configuration.Function
Register-PSRepositoryRegisters a PowerShell repository.Function
Get-WindowsCapabilityGets Windows capabilities for an image or a running operating system.Cmdlet
Get-BitLockerVolumeGets information about volumes that BitLocker can protect.Function
Get-ClipboardGets the current Windows clipboard entry.Cmdlet
Get-ComputerInfoGets a consolidated object of system and operating system properties.Cmdlet
Get-InitiatorPortGets one or more host bus adapter (HBA) initiator ports.Function
Get-BitsTransferGets the associated BitsJob object for an existing BITS transfer job.Cmdlet
Get-AuthenticodeSignatureGets information about the Authenticode signature for a file.Cmdlet
Get-AppvClientPackageReturns App-V Client Packages.Cmdlet
Set-WSManQuickConfigConfigures the local computer for remote management.Cmdlet
New-GuidCreates a GUID.Function
Get-StorageJobReturns information about long-running Storage module jobs, such as a repair task.Function
Uninstall-ModuleUninstalls a module.Function
Get-InstalledModuleGets installed modules on a computer.Function
Confirm-SecureBootUEFIConfirms that Secure Boot is enabled by checking the Secure Boot status on the local computer.Cmdlet
Set-ClipboardSets the current Windows clipboard entry.Cmdlet
Get-TlsCipherSuiteGets the list of cipher suites for TLS for a computer.Cmdlet
Clear-DiskCleans a disk by removing all partition information and un-initializing it, erasing all data on the disk.Function

The data presented in this table are used under a CC BY 4.0 License. Modifications include syntactic styling.

Windows server core 远程管理

Windows server core 不带GUI,不像winserver 2003 那样容易使用, 但是可以使用Server Manager 来 远程管理。

先在server core 当中运行sconfig, 对服务器进行基本配置,设置服务器电脑名、IP。在管理端运行以下命令:

Set-Item wsman:\localhost\Client\TrustedHosts 服务器电脑名 -Concatenate -Force

将server core 加入信任的机器列表,然后就可以在管理端运行server manager 并添加server core 进行管理。但是Server manager 提供的功能很有限,推荐使用power shell 进行远程管理。


Cython 可以把python代码翻译成c\c++源代码,然后就可以用cl,gcc等编译器编译成可执行文件。经过我的实际测试,支持tkinter,可以生成带图形界面的程序,可以去掉黑框。

cython -3 --embed -o run.c
cl /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I"C:\Program Files\Python37\include" /Tc run.c /DWIN32
link run.obj /SUBSYSTEM:CONSOLE /MACHINE:X64 /LIBPATH:"C:\Program Files\Python37\libs"
link run.obj /SUBSYSTEM:WINDOWS /MACHINE:X64 /LIBPATH:"C:\Program Files\Python37\libs" /ENTRY:"wmainCRTStartup"

生成的可执行文件任然依赖于python的运行时环境(如python.dll, 程序使用到的标准模块pyd等,而且必须是同一版本的运行时)。Cython不能把所有依赖打包成一个包,如果需要将所有依赖打包并复制到未安装python的电脑上运行,则比较麻烦。




最开始发包(sendto)的时候,一切顺利,但是后来死活不能接收广播包。recvfrom 要么超时,要么一直堵塞着(blocked),耽搁了一天的时间,后来仔细谷歌,才发现是因为内核使用了反向过滤的技术。只要关闭就行了。怎么关闭呢:


sysctl -w  net.ipv4.conf.all.rp_filter=0

sysctl -w  net.ipv4.conf.eth0.rp_filter=0



if (recvfrom(sock, (void*)dhcp_reply, sizeof(dhcp_reply), 0, (struct sockaddr*)&servAddr, (socklen_t*)&revedAddrLen) == -1) {
			fprintf(stderr, "未收到 DHCP Offer消息:%s\n请尝试用root用户运行 sysctl -w  net.ipv4.conf.all.rp_filter=0\nsysctl -w  net.ipv4.conf.eth1.rp_filter=0", strerror(errno));


SIA coin 小记

今天,在网络上偶然发现了一个叫 sia 的基于区块链的云储存服务开源软件。官方网址,GITHUB网址:

该软件发行了一种SIA coin的数字货币,该数字货币的目标不像比特币想作为一种通用现金那样宏伟。SIA coin 是作为自己自己平台上的一种服务凭证,更相当于现实生活中商家发行的消费券、代金券这样的私人凭证。

SIA整个系统向外部提供收费云储存服务,用户可以通过SIA-GUI软件向SIA系统上传自己的文件,文件在上传之前会加密,加密后的内容会上传于多个Host上。同时用户在上传时,也必须声明要保存的时间,比如说一年,两年或者还是保存3个月。文件体积越大、时间越长需要的SIA coin越多。

Host 就是向外部提供储存服务的主要节点,其实更相当于快递商的加盟模式,任何一台因特网上的主机,只要具备几个条件,就可以成为一个Host,而向外部出租自己多余的储存空间和宽带。目前的条件有,(条件不一定完全准确,因为我不能确定自己看到的是不是最新资料):



3、你需要有中够的sia coin 用于抵押担保,你能按时按量正确地保存客户的资料,SIA 系统里的智能合约(smart contract) 会随时让你的host 证明你仍然保存着用户的文件(Storage prove) 如果你的host 不能证明着你还保存着用户的文件,你用于抵押的sia coin 就将被合约转给用户,以补偿用户的损失。


目前SIA 官方网站上声称可以提供比amazon S3 更便宜的云储存服务。



1、vnpy 量化交易平台



Cryptocurrency trading bot written in Golang

Build Status Test Coverage

A cryptocurrency trading bot supporting multiple exchanges written in Golang.

Please note that this bot is under development and is not ready for production!

Exchange Support Table

Exchange REST API Streaming API FIX API
Alphapoint Yes Yes NA
Bitfinex Yes Yes NA
Bitstamp Yes Yes NA
BTCC Yes Yes No
BTCMarkets Yes NA NA
GDAX(Coinbase) Yes Yes No
Gemini Yes NA NA
Huobi Yes Yes No
ItBit Yes NA NA
Kraken Yes NA NA
LakeBTC Yes Yes NA
LocalBitcoins Yes NA NA
OKCoin (both) Yes Yes No
Poloniex Yes Yes NA

** NA means not applicable as the Exchange does not support the feature.

Current Features

  • Support for all Exchange fiat and digital currencies, with the ability to individually toggle them on/off.
  • REST API support for all exchanges.
  • Websocket support for applicable exchanges.
  • Ability to turn off/on certain exchanges.
  • Ability to adjust manual polling timer for exchanges.
  • SMS notification support via SMS Gateway.
  • Basic event trigger system.

Planned Features

  • WebGUI.
  • FIX support.
  • Expanding event trigger system.
  • TALib.
  • Trade history summary generation for tax purposes.

Please feel free to submit any pull requests or suggest any desired features to be added.

Compiling instructions

Download Go from
Using a terminal, type go get
Change directory to the package directory, then type go install.
Copy config_example.json to config.json.
Make any neccessary changes to the config file.
Run the application!


Binaries will be published once the codebase reaches a stable condition.


Coin Trader

Coin Trader is a Java-based backend for trading cryptocurrencies, released under the Apache License. It features:

  • Connectivity to many exchanges
  • Control console (text)
  • Basic order routing
  • Simulated trading
  • Live order execution
  • Schema and persistence
  • CSV output of market data
  • Ad-hoc table reports
  • Modular infrastructure
  • Backtesting
  • Accounting
  • Library of quantitative indicators (TaLib)
  • Bitcoin derivatives (Futures & Swaps)
  • Implied price calculation across multiple markets
  • Base currency accounting
  • 24 Hr OHLC bars

Coin Trader’s future goals include:

  • Reconciliation
  • Flexible data output
  • Web console & graphing


Tim presents Coin Trader at the SF Bitcoin Dev meetup.


Coin Trader requires Java JDK 1.7, Maven, and a SQL database (MySQL default).
Setup Instructions


See the Wiki for more information.
There’s no mailing list, so open a new issue for anything, help or just discussion. Tag it with “Question” and I’ll follow through with you.

Automated Trading

To implement signals and automated strategies, you connect Esper event queries to Java code like this:

@When( "select avg(priceAsDouble) from sec)" )
void checkMovingAverage( double avg )
  if( avg > trigger )
    context.publish( new MyIndicator(5.31) );

@When( "select * from MyIndicator where myIndicatorValue > 5.0" )
void enterTrade( MyIndicator s )
  orders.create( Listings.BTC_USD, 1.0 )
        .withLimit( 650.25 )

You then attach this class to a Context to receive Esper event rows as method invocations.

24Hr OHLC Bars

Strategy needs to implement a .getInterval() method to return a double in seconds of the size of the bar.

Default simple statful stretegy is 86400 (24Hr) cointrader-esper.cfg.xml

<plugin-view factory-class="org.cryptocoinpartners.esper.OHLCBarPlugInViewFactory" name="ohlcbar" namespace="custom"/>  


  • Create an esper named window to add the OHLC bars into
create window
    select *
  • Add the OHLC bars to it
insert into OHLCShortWindow
select * 
 from  Trade.custom:ohlcbar(timestamp, priceCountAsDouble, market,TestStrategy.getInterval());

  • Select values from OHLC bar window
select * from OHLCShortWindow as ohlc 



<plugin-aggregation-function name="talib" function-class="org.cryptocoinpartners.esper.GenericTALibFunction"/>  


select coalesce(talib("atr", max, min, last, 9),0) as atr from OHLCShortWindow;

Console Demo

The Coin Trader Console gives you a peek into the engine.

$ ./ console

Coin Trader Console 0.3.0-SNAPSHOT

ct> help
Type "help {command}" for more detailed information.
Available commands:
    • attach
    • buy
    • csv
    • currencies
    • data
    • exchanges
    • exit
    • help
    • jpa
    • listings
    • markets
    • sell
    • set
    • unset
    • unwatch
    • watch
    • watches

ct> data summary
|      Market      | Num Trades | Num Books |
|     BTCE:BTC.USD |       8149 |      2671 |
| BITFINEX:BTC.USD |       3509 |      2551 |
| BITSTAMP:BTC.USD |       1344 |       901 |
| BITFINEX:DRK.USD |       1000 |        21 |
| BITFINEX:DRK.BTC |       1000 |        21 |
| BITFINEX:LTC.USD |       1000 |        22 |
| BITFINEX:LTC.BTC |       1000 |        22 |
| BTCCHINA:BTC.CNY |        134 |        31 |
| BTCCHINA:LTC.CNY |        110 |        31 |
| BTCCHINA:LTC.BTC |        102 |        31 |
|     BTER:BTC.CNY |         47 |         7 |
|     BTER:LTC.BTC |         38 |        84 |
|    BTER:DOGE.CNY |         26 |         7 |
|     BTER:NXT.CNY |         26 |         6 |
|     BTER:DRK.CNY |         23 |         6 |
|    BTER:DOGE.BTC |         23 |         6 |
|     BTER:LTC.CNY |         21 |         7 |
|     BTER:XCP.CNY |         20 |         6 |
|     BTER:DRK.BTC |         19 |         6 |
|     BTER:XCP.BTC |         18 |        12 |
|     BTER:NXT.USD |          2 |         6 |

ct> watch btc.usd
now watching BTC.USD

book: BITFINEX:BTC.USD    587.4 (0.317861) - 588.82 (-1.54641998)
book: BTCE:BTC.USD    583.92 (0.01499999) - 585.99 (-0.01819054)
book: BITSTAMP:BTC.USD    588.79 (0.99999999) - 590.33 (-0.19199999)
book: BITFINEX:BTC.USD    587.4 (0.317861) - 588.81 (-13.94196839)
book: BTCE:BTC.USD    583.92 (0.01499999) - 585.99 (-0.01819054)
trade: BITSTAMP:BTC.USD    590.33 (0.03489999)
book: BTCE:BTC.USD    583.92 (0.01499999) - 585.99 (-0.01819054)
book: BITFINEX:BTC.USD    587.4 (0.317861) - 588.8 (-31.37994228)
book: BTCE:BTC.USD    583.92 (0.01499999) - 585.99 (-0.01180944)

ct> unwatch btc.usd
no longer watching BTC.USD

ct> buy 10.0 bitfinex:btc.usd
Sending order SpecificOrder{id=d5a2ff79-0eca-445d-a3b3-75d1e80265a7, parentOrder=null, market=BITFINEX:BTC.USD, volumeCount=1000000000}
Order has been placed. SpecificOrder{id=d5a2ff79-0eca-445d-a3b3-75d1e80265a7, parentOrder=null, market=BITFINEX:BTC.USD, volumeCount=1000000000}

Filled order d5a2ff79-0eca-445d-a3b3-75d1e80265a7: Fill{order=d5a2ff79-0eca-445d-a3b3-75d1e80265a7, market=BITFINEX:BTC.USD, price=585.57, volume=2.11486695}
Order is partially filled SpecificOrder{id=d5a2ff79-0eca-445d-a3b3-75d1e80265a7, parentOrder=null, market=BITFINEX:BTC.USD, volumeCount=1000000000, averageFillPrice=585.57}
Filled order d5a2ff79-0eca-445d-a3b3-75d1e80265a7: Fill{order=d5a2ff79-0eca-445d-a3b3-75d1e80265a7, market=BITFINEX:BTC.USD, price=585.58, volume=7.88513305}
Order has been completely filled.  SpecificOrder{id=d5a2ff79-0eca-445d-a3b3-75d1e80265a7, parentOrder=null, market=BITFINEX:BTC.USD, volumeCount=1000000000, averageFillPrice=585.57788513305}

ct> buy 1 btc.usd
Creating order GeneralOrder{id=a4664af4-a21d-4b77-a999-bc8a78a8d951, parentOrder=null, listing=BTC.USD, volume=1}
Order has been placed. SpecificOrder{id=3ff02408-8269-4bf9-929f-8d2ca060f6fc, parentOrder=a4664af4-a21d-4b77-a999-bc8a78a8d951, market=BITSTAMP:BTC.USD, volumeCount=100000000}

Filled order 3ff02408-8269-4bf9-929f-8d2ca060f6fc: Fill{order=3ff02408-8269-4bf9-929f-8d2ca060f6fc, market=BITSTAMP:BTC.USD, price=584.99, volume=1}
Order has been completely filled.  SpecificOrder{id=3ff02408-8269-4bf9-929f-8d2ca060f6fc, parentOrder=a4664af4-a21d-4b77-a999-bc8a78a8d951, market=BITSTAMP:BTC.USD, volumeCount=100000000, averageFillPrice=584.99}
Order has been completely filled.  GeneralOrder{id=a4664af4-a21d-4b77-a999-bc8a78a8d951, parentOrder=null, listing=BTC.USD, volume=1}


ct> exit


转 Esper开发之一

By: rsljdkt







CEP,:Complex Event Process,复杂事件处理,是一种新兴的基于事件流的技术,它用于处理事件,从事件流中发现复杂的模式。它将系统数据看做不同类型的事件,通过分析事件间的关系,建立不同事件关系序列库,利用过滤、关联、聚合等技术,最终由简单事件产生高级事件或商业流程。

ESP,Event Stream Process,事件流处理,目的是从事件流中获得有用的事件,进而从中获得有用信息。实时OLAP(联机分析处理)和连续查询者两个术语常常和ESP是同义语。



Esper官网是这么定义的:”Esper is a component for CEP and ESP applications”,中文意思是:Esper是用于CEP(复杂事件处理)和ESP(事件流处理)应用程序的组件。



Ø 业务处理管理和自动化(处理监控,业务活动监控,异常报告,经营智能化等等)

Ø 财务(算法交易,欺诈检查,风险管理)

Ø 网络及应用程序监控(入侵检测,SLA(Service Level Agreement)监控)

Ø 传感器网络应用(RFID 读取,生产线调度和控制,空中交通)


1.阅读Esper官网上的tutorials,  case  studies  and  solution  patterns。

   n Tutorial-本篇是 Esper 的教程,主要介绍了(1)什么是Esper,它有什么优点,包括哪些component(2)什么是事件流,什么是复杂事件。(3)什么是 EPL(4)如何开发一个事件驱动的应用(5)如何设计事件(6)事件流分析(7)事件模式匹配(8)如何结合事件流分析与模式匹配

   n Quick Start – 本篇主要描述如何快速使用 Esper,包括(1)安装 (2)创建Java事件类,POJO对象作为事件(3)创建一个 Statement (4)添加一个Listener(5)发送事件(6)Esper配置

   n Articles and Presentations, 文章和报告,这里列举了某些文章和展示材料,有些sample可以下载,对于学习和熟悉很有帮助

   n Solution Patterns,解决方案模式,使用Q&A的模式,对CEP 和 Esper 进行阐述,对于整个 Esper 的背景知识,会有很大帮助

   n Short Case Study, 简短的个案研究,以传输监控为例,进行分析,

   n Longer Case Study,较大个案研究,多个事件构成一次事务,对此进行分析

   n Additional Examples,其它示例,描述了怎么在 JMS, J2EE等环境里使用

   n Technology Links,技术链接,一些参考网站的引用

   n Documentation,文档,这里有很多文档供下载到本地

   n Building Esper,介绍如何使用 Maven 来build Esper












三、Quick Start









1.创建一个Event class








1.创建一个Event class

  1. package org.rsljdkt.rsc.esper.event;
  2. public class OrderEvent {
  3.     public double price;
  4.     public String itemName;
  5.     public OrderEvent() {
  6.         super();
  7.     }
  8.     public OrderEvent(double price, String itemName) {
  9.         super();
  10.         this.price = price;
  11.         this.itemName = itemName;
  12.     }
  13.     public double getPrice() {
  14.         return price;
  15.     }
  16.     public String getItemName() {
  17.         return itemName;
  18.     }
  19. }


  1. package org.rsljdkt.rsc.esper.listener;
  2. import com.espertech.esper.client.EventBean;
  3. import com.espertech.esper.client.UpdateListener;
  4. public class OrderListener implements UpdateListener {
  5.     @Override
  6.     public void update(EventBean[] newEvents, EventBean[] oldEvents) {
  7.         EventBean eb = newEvents[0];
  8.         System.out.println(eb.get(“avgPrice”));
  9.     }
  10. }


  1. import org.rsljdkt.rsc.esper.event.OrderEvent;
  2. import org.rsljdkt.rsc.esper.listener.OrderListener;
  3. import com.espertech.esper.client.Configuration;
  4. import com.espertech.esper.client.EPServiceProvider;
  5. import com.espertech.esper.client.EPServiceProviderManager;
  6. import com.espertech.esper.client.EPStatement;
  7. public class Main {
  8.     public static void main(String[] args) {
  9.         //Creating a configuration
  10.         Configuration config= new Configuration();
  11.         config.addEventTypeAutoName(“org.rsljdkt.rsc.esper.event”);//添加包路径,这样在查询表达式中就不需要写类的全路径了
  12.         //Creating a statement
  13.         EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider(config);
  14.         //查询最近30秒钟到达的OrderEvent事件平均价格
  15.         String expression = “Select Avg(price) As avgPrice From sec)”;
  16.         EPStatement statement = epService.getEPAdministrator().createEPL(expression);
  17.         //Adding a listener
  18.         statement.addListener(new OrderListener());
  19.         //Sending events
  20.         for(int i = 0 ; i<10;i++){
  21.             epService.getEPRuntime().sendEvent(new OrderEvent((i+1)*10,“Name”+i));
  22.         }
  23.     }
  24. }



  1. 10.0
  2. 15.0
  3. 20.0
  4. 25.0
  5. 30.0
  6. 35.0
  7. 40.0
  8. 45.0
  9. 50.0
  10. 55.0





一、     比特币体系











二、     以太坊ETH

刚结束的以太坊全球开发者大会DEVCON2,吸引了无数大牛到上海,可以看到,以太坊生态系统正在高速地成长着,正朝着成为“世界计算机”的目标前进。无论是the DAO众筹到攻击,还是ETH与ETC 分道扬镳,或者是各种以太坊生态的开发框架和应用,以太坊目前在区块链平台是最吸引眼球的。

以太坊是一个图灵完备的区块链一站式开发平台,采用多种编程语言实现协议,采用Go语言写的客户端作为默认客户端(即与以太坊网络交互的方法, 支持其他多种语言的客户端)。基于以太坊平台之上的应用是智能合约,这是以太坊的核心。智能合约配合友好的界面和外加一些额外的小支持,可以让用户基于合约搭建各种千变万化的DApp应用,这样使得开发人员开发区块链应用的门槛大大降低。


目前以太坊正在正式运行1.0版本,采用的是POW挖矿的共识算法,目前公网的TPS是25笔,在开发中的1.5版本,将采用类POS的Casper算法,以使区块链的确认速度相对于POW的线性效率,达到指数级。采用Casper后将会更好的确认机制,以及大幅降低能量消耗。在规划的 2.0版本目标,TPS有望可以达到2000TPS。


三、     IBM HyperLedger fabric

IBMHyperLedger,又叫 fabric,是一个带有可插入各种功能模块架构的区块链实施方案,他的目标是打造成一个由全社会来共同维护的一个超级账本。Elwin个人感觉fabric分层设计比较合理,模块化程度非常不错,虽然目前还是在完善阶段,并没有真正商用(最近IBM携手中国银联打造区块链为基础的忠诚积分交易系统,但还是属于探索试样项目),但以IBM的多年技术底蕴,fabric应该是大企业构建区块链底层的选择之一。

fabric架构核心逻辑有三条:Membership、Blockchain和Chaincode。MembershipServices这项服务用来管理节点身份、隐私、保密性、可审计性。Blockchain services使用建立在HTTP/2上的P2P协议来管理分布式账本,提供最有效的哈希算法来维护区块链世界状态的副本。采取可插拔的方式来根据具体需求来设置共识协议,比如PBFT,Raft,PoW和PoS等等,IBM首选PBFT算法。Chaincode services 会提供一种安全且轻量级的沙盒运行模式,来在VP节点上执行chaincode逻辑,类似以太坊的EVM虚拟机及其他上面运行的智能合约。

开源地址:。Fabric的主要框架核心开发语言是Go语言,系统目标是15个验证节点下最理想情况下可以有100K TPS的性能,更适合于联盟链。

四、     比特股BitShare




五、     公证通Factom






六、     瑞波Ripple


Ripple有两个重要概念,其一是推出Ripple币瑞波币——XRP,它作为Ripple网络的基础货币,就像比特币一样可以整个网络中流通,主要是燃料Gas的作用,每产生一笔交易就会消耗一些 XRP;其二是引入网关(Gateway)系统,它类似于货币兑换机构,允许人们把法定货币注入、抽离Ripple网络,并可充当借、贷双方的桥梁。




七、     未来币NXT




Nxt区块链2.0已经在讨论和计划实施中了,其核心思路就是要通过主链(Main Chain)和子链(Child Chain)的这种架构来增加Nxt区块链的可扩展性和可删减性,从而解决长期存在的区块链膨胀等问题;




英特尔的锯齿湖(Sawtooth Lake),目前是用于建造、部署和运行分布式账本的高度模块化平台,重点领域在数字资产,在锯齿湖的数据模型和交易事务语言中,是由称为“transaction family”的体系来实现的, 給用户可以有开箱即用的功能齐全的市场数字资产管理体系。采用PoET和Quorum Voting两种共识算法,框架核心开发语言Python,开源地址为

布比区块链,目前采用的是对联盟链内定向开源,共识算法采用自研发的Pool验证池,可以集成Byzantine Paxos、Byzantine、Raft等商用共识算法,实现免Gas费用的秒级共识验证,框架核心开发语言是C++,应用场景比较广泛。














以太坊ETH 1.0





IBM HyperLedger fabric































5、PoET(Proof ofElapsed Time),也就是‘消逝时间量证明’,它是由英特尔构建在可信执行环境的一种彩票协议。



8、PBFT(PracticalByzantine Fault Tolerance)算法,拜占庭容错算法,属于状态机拜占庭协议,IBM HyperLedger fabric实现和推荐的共识算法,采取一个节点一票的方案确定记账结果,少数服从多数投票,性能较好,主要用于联盟链。

使用perl 查找str序列


#!/usr/bin/perl -w
use strict;
use Bio::SeqIO;
#use Bio::Tools::TandemRepeatsFinder;
#Bio perl 需要事先安装
# 1、安装cpanm 
#		wget -O /usr/bin/cpanm;
#		chmod +x /usr/bin/cpanm
# 2、安装Bio::perl
#	cpanm --mirror --mirror-only Bio::Perl
sub found_str{
	my %STRS;
	my $seqio_obj = Bio::SeqIO->new(-file => $_[0], -format => "fasta" );
	while (my $seq_obj = $seqio_obj->next_seq ) {
		my @agcts=split('',$seq_obj->seq); #将记录转换成字符数组
		my $agct_length= length $seq_obj->seq;
		my $start_index=0;
		for(my $j=$start_index;$j<$agct_length-1;$j=$start_index){
			my @end_indexs=(0,0,0,0,0);
			my @repeated_times=(0,0,0,0,0); #记录当周期分别2、3、4、5、6时的重复周期数
			for(my $i=2;$i<=6;$i=$i+1){ #分别搜索当周期数为2、3、4、5、6时的str 长度与周期数
				my $breaks=0;
				for(my $j=$start_index;$j<$agct_length-1;$j=$j+$i){
					my $k;
						if($j+$k+$i>=$agct_length-1 || ($agcts[$j+$k]  ne $agcts[$j+$k+$i])){
			my $max_end_index=0;
			my $max_repeat_peroid=0;
			for(my $i=2;$i<=6;$i=$i+1){
			if($max_repeat_peroid!=0 and $start_index>8 and $max_end_index+9< $agct_length and $repeated_times[$max_repeat_peroid-2]+1 >5){
				#本次搜索到了STR 串,将找到的STR串放入最终结果
				#本次搜索到了STR 串,右移下标 STR长度
				my $repeated_times = $repeated_times[$max_repeat_peroid-2]+1;
				my $start_bp = substr($seq_obj->seq,$start_index-8,8);
				my $repeated_element = substr($seq_obj->seq,$start_index,$max_repeat_peroid);
				my $end_bp = substr($seq_obj->seq,$max_end_index,8);
				my $str = "$start_bp\_$repeated_element\_$end_bp";				
				if( exists $STRS{$str}) {
					push @{$STRS{$str}}, $repeated_times[$max_repeat_peroid-2]+1;
				} else {
					my @nums=($repeated_times[$max_repeat_peroid-2]+1);
	select OUT;
	print ("need_seq\tfind_cishu\tmeicichongfucishu\n");
	foreach my $key (keys %STRS){
		my $count = @{$STRS{$key}};
		print ($key,"	",$count ,"	");
		foreach my $num (@{$STRS{$key}}){
			print ($num,";");
		print ("\n");